Need help with Python_Basics?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

learnbyexample
495 Stars 184 Forks 148 Commits 0 Opened issues

Description

:snake: Syntax, working with Shell commands, Files, Text Processing, and more...

Services available

!
?

Need anything else?

Contributors list

No Data

Python Basics

Introduction to Python - Syntax, working with Shell commands, Files, Text Processing, and more...

  • Suitable for a one/two day workshop for Python beginners
  • Visit Python re(gex)? repo for a book on regular expressions
  • Python resources for everybody for a curated and searchable collection, including resources for complete beginners to programming
  • For more related resources, visit scripting course and my programming blog https://learnbyexample.github.io

:warning: :warning: I'm no longer actively working on this repo. I'm archiving this repo for now, might come back later to update the book to newer Python version, add more content, etc.



Chapters

  • Introduction
    • Installation, Hello World example, Python Interpreter, Python Standard Library
  • Number and String data types
    • Numbers, String, Constants, Built-in Operators
  • Functions
    • def, print function, range function, type function, Variable Scope
  • Getting User input
    • Integer input, Floating point input, String input
  • Executing external commands
    • Calling Shell commands, Calling Shell commands with expansion, Getting command output and redirections
  • Control Structures
    • Condition checking, if, for, while, continue and break
  • Lists
    • Assigning List variables, Slicing and Modifying Lists, Copying Lists, List Methods and Miscellaneous, Looping, List Comprehension, Getting List as user input, Getting random items from list
  • Sequence, Set and Dict data types
    • Strings, Tuples, Set, Dictionary
  • Text Processing
    • String methods, Regular Expressions, Pattern matching and extraction, Search and Replace, Compiling Regular Expressions, Further Reading on Regular Expressions
  • File handling
    • open function, Reading files, Writing to files, Inplace editing with fileinput
  • Command line arguments
    • Known number of arguments, Varying number of arguments, Using program name in code, Command line switches
  • Exception Handling and Debugging
    • Exception Handling, Syntax check, pdb, Importing program
  • Docstrings
    • Style guide, Palindrome example
  • Testing
    • assert statement, Using assert to test a program, Using unittest framework, Using unittest.mock to test user input and program output, Other testing frameworks
  • Exercises
  • Further Reading
    • Standard topics not covered, Useful links on coding, Python extensions


Contributing

  • Please open an issue for typos/bugs/suggestions/etc
    • As this repo is no longer actively worked upon, please do not submit pull requests
  • Share the repo with friends/colleagues, on social media, etc to help reach other learners
  • In case you need to reach me, mail me at
    echo 'bGVhcm5ieWV4YW1wbGUubmV0QGdtYWlsLmNvbQo=' | base64 --decode
    or send a DM via twitter


ebook

  • Read as ebook on gitbook
  • All
    legacy.gitbook.com
    links are now automatically redirected to
    gitbook.com
    , so there's no longer an option to download ebooks for offline reading


Acknowledgements


License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.