🎯 Master Python🐍in 10 minutes 🀯

🎯 Master Python🐍in 10 minutes 🀯

Let us go on a journey to do cool things with Python 😁

Β·

4 min read

Table of contents

1. Getting Started

✌ What is Python ?

Desktop - 6.png

✌ Installing Python

  1. Download python from python.org Screenshot (172).png
  2. Run the installer, check 'Add Python 3.10 to PATH', and install. install python.gif
  3. Check the python version in the command prompt by using python command. Screenshot (171).png
  4. Download the latest version of VSCode editor from code.visualstudio.com
  5. Add Python extension from marketplace. Screenshot (174).png

✌ Your First Python Program

  1. Create app.py and open it in VS Code.
  2. Run the file in the terminal using python app.py carbon.png

2. Primitive Types

✌ Variables

  • Variables are used to store values in a computer's memory. carbon.png
  • Python is a case-sensitive language.

✌ Variable Names

  • Variable names should be meaningful and descriptive.
  • lowercase is used for naming
  • Underscore(_) is used to separate multiple words
  • space around =

✌ String

carbon.png

✌ Escape Sequences \" , \' , \, \n

carbon.png

✌ Formatted Strings

carbon.png

✌ String Methods

carbon.png

carbon.png

carbon.png

✌ Numbers

carbon.png

carbon.png

✌ Working with Numbers

carbon.png

✌ Type Conversion int(x), float(x), bool(x), str(x)

carbon.png

carbon.png

3. Control Flow

✌ Comparison Operators

carbon.png

✌ Conditional Statements

carbon.png

✌ Ternary Operator

carbon.png

✌ Logical Operators and,or,not

carbon.png

✌ Short-circuit Evaluation

carbon.png

✌ Chaining Comparison operators

carbon.png

✌ For Loops

carbon.png

✌ For..Else

carbon.png

✌ Nested Loops

carbon.png

✌ Iterables

carbon.png

✌ While loops

carbon.png carbon.png

✌ Infinite Loops

carbon.png

4. Functions

✌ Defining Functions

carbon.png

✌ Arguments

carbon.png

✌ Types of Functions

carbon.png carbon.png

✌ Keyword Arguments

carbon.png

✌ Default Arguments

carbon.png

✌ *args

carbon.png

✌ **args

carbon.png

✌ Scope

carbon.png

✌ Debugging (VERY IMPORTANT) : find and fix the bug

carbon.png

  • Run and debug -> Create launch.json file -> Python file

  • F9 -> insert a breakpoint

  • F5 -> run the application to this point

  • F10 -> execute one statement at a time

  • If we press F10 again execution stops

  • This time we want to step inside this multiply function so instead, press F11

  • Now we go inside the multiply function

  • Press F10 to go to the next line

  • Shift + F5 -> to stop the debugger

  • If we find the problem is a function set debug point inside that function

  • If we find everything is alright inside a function, use Shift + F11 -> to step out of that function

✌ VSCode Shotcut Windows

  • Home : beggining of line

  • End : end of line

  • Ctrl + Home/End : begin/end of file

  • Alt + Up/Down : move whole line up/down

  • Shift + Alt + up/down : copy line

  • Ctrl + / : comment

5. Data Structures

✌ Lists

carbon.png

✌ Accessing Items

carbon.png

✌ List Unpacking

carbon.png

✌ Looping over Lists

carbon.png

✌ Adding/Removing items

carbon.png

✌ Finding Items

carbon.png

✌ Sorting Lists

carbon.png

✌ Lambda Functions

carbon.png

✌ Map Function

carbon.png

✌ Filter Function

carbon(1).png

✌ List Comprehensions

carbon.png

✌ Zip Function

carbon.png

✌ Stacks

carbon.png

✌ Queues

carbon.png

✌ Tuples

carbon.png

✌ Swapping Variables

carbon.png

✌ Arrays

carbon.png

✌ Sets

carbon.png

✌ Dictionaries

carbon.png

✌ Dictionary Comprehensions

carbon.png

✌ Generator Expressions

carbon.png

✌ Unpacking Operator

carbon.png

6. Exceptions

✌ Exceptions

✌ Handling Exceptions

✌ Handling Different Exceptions

✌ Cleaning Up

✌ The With Statement

✌ Raising Exceptions

✌ Cost of Raising Exceptions

7. Classes

✌ Classes

✌ Creating Classes

✌ Constructors

✌ Class vs Instance Attributes

✌ Class vs Instance Methods

✌ Magic Methods

✌ Comparing Objects

✌ Performing Arithmetic Operations

✌ Making Custom Containers

✌ Private Members

✌ Properties

✌ Inheritance

✌ The Object Class

✌ Method Overriding

✌ Multi-level Inheritance

✌ Multiple Inheritance

✌ A Good Example of Inheritance

✌ Abstract Base Classes

✌ Polymorphism

✌ Duck Typing

✌ Extending Built-in Types

✌ Data Classes

8. Modules

✌ Creating Modules.mp4

✌ Compiled Python Files.mp4

✌ Module Search Path.mp4

✌ Packages.mp4

✌ Sub-packages.mp4

✌ Intra-package References.mp4

✌ The dir Function.mp4

✌ Executing Modules as Scripts

Β