This is a simple book to learn Python programming language, it is for the programmers who are new to Python.
Python is a simple yet powerful programming language that can enable you to start thinking like a programmer right from the beginning. It is very readable and the stress many beginners face about memorizing arcane syntax typically presented by other programming languages will not affect you at all. Conversely, you will be able to concentrate on learning concepts and paradigms of programming.
Conditions of Use
This book is licensed under a Creative Commons License (CC BY-NC-SA). You can download the ebook Python for You and Me for free.
- Title
- Python for You and Me
- Author(s)
- Kushal Das
- Published
- 2023-03-19
- Edition
- 1
- Format
- eBook (pdf, epub, mobi)
- Pages
- 175
- Language
- English
- License
- CC BY-NC-SA
- Book Homepage
- Free eBook, Errata, Code, Solutions, etc.
Installation On Windows On GNU/Linux The Beginning Using the Python interpreter Using a source file Whitespaces and indentation Comments Modules Evaluation your code from a Python file in the interpreter Using mu editor Installation Using mu Executing code Variables and Datatypes Keywords and Identifiers Reading input from the Keyboard Some Examples Multiple assignments in a single line Formatting strings Operators and expressions Operators Example of integer arithmetic Relational Operators Logical Operators Shorthand Operator Expressions Type Conversions evaluateequ.py quadraticequation.py salesmansalary.py If-else , the control flow If statement Else statement Truth value testing match statements Learning using hardware simulation Circuit Playground Express Turning on all NeoPixels on the board with Red colour Looping While loop Fibonacci Series Power Series Multiplication Table Some printing * examples Lists For loop range() function Continue statement Else statement in a loop Game of sticks Looping over hardware One NeoPixel at a time First Red and then Blue Data Structures Lists Using lists as stack and queue List Comprehensions A few special functions related to lists Tuples Sets Dictionaries students.py Assignment problems Create a calculator Strings Different methods available for Strings Strip the strings Justifying text Finding text Palindrome checking Number of words Iterating over all characters of a string Functions Defining a function Local and global variables Default argument value Keyword arguments Keyword only argument Positional only argument Docstrings Higher-order function map Parameters and arguments *args and **kwargs in function definition HOWTO Write a function File handling File opening Closing a file Reading a file Using the with statement Writing in a file copyfile.py Count spaces, tabs and new lines in a file Let us write some real code Exceptions NameError TypeError How to handle exceptions? Raising exceptions Using finally for cleanup Class Your first class __init__ method Unique class level variables __repr__ method Inheritance Multiple Inheritance Encapsulation in Python Deleting an object Getters and setters in Python Properties Special dunder methods in classes Creating a new context manager Deep down inside Modules Introduction Importing modules Packages and submodules __all__ in __init__.py Default modules Module os Requests Module Command line arguments TAB completion in your Python interpreter Collections module Counter defaultdict namedtuple Using VS Code as your primary Python editor Installing VS Code Using VS Code Install the Python extension Start working on your code Install the Device Simulator Express extension PEP8 Guidelines Introduction A Foolish Consistency is the Hobgoblin of Little Minds Code lay-out Whitespace in Expressions and Statements Comments Version Bookkeeping Naming Conventions References Copyright Iterators, generators and decorators Iterators Generators Generator expressions Closures Decorators Virtualenv Installation Usage Pipenv Pipfile and Pipfile.lock Type hinting and annotations First example of type annotation Using mypy and more examples More examples of type annotations Simple testing in Python What we should test ? Unit testing unittest module Factorial code Which function to test ? Our first test case Description Different assert statements Testing exceptions mounttab.py After refactoring Test coverage Coverage Example A project structure Primary code LICENSE file Installing flit package pyproject.toml Building a package Python Package Index (PyPI) Install from the test PyPI More readings Building command line applications with Click Installation, and development tips Using echo for printing text Boolean flags Standard options in the command line Same option multiple times Help text for the script Super fast way to accept password with confirmation Must have arguments Simple GUI application development using PyperCard Installing PyperCard in a virtualenv Hello World example Two Cards and a button Taking simple text input Check name problem Check name solution Introduction to Flask What is flask? What are template engines? A “Hello world” application in flask Using arguments in Flask Additional work Index
Related Books