Python Crash Course
A beginner-to-intermediate quick guide to Python programming.
1. Getting Started
Python is a high-level, readable programming language.
Run code with: python [Link]
Print output: print('Hello World')
2. Variables & Data Types
name = 'Raven'
age = 20
height = 1.75
is_student = True
3. Input & Output
name = input('Enter name: ')
print('Hello', name)
4. Operators
+, -, *, /, //, %, **
==, !=, >, <, >=, <=
5. Conditional Statements
if, elif, else
6. Loops
for i in range(5):
print(i)
while condition:
pass
7. Functions
def greet(name):
return f'Hello {name}'
8. Lists
fruits = ['apple', 'banana']
[Link]('orange')
9. Dictionaries
user = {'name':'Raven', 'age':20}
print(user['name'])
10. Classes & OOP
class Person:
def __init__(self, name):
[Link] = name
11. File Handling
with open('[Link]', 'r') as f:
data = [Link]()
12. Modules
import math
print([Link](25))
13. Error Handling
try:
pass
except Exception as e:
print(e)
14. Useful Built-ins
len(), type(), range(), enumerate(), zip(), sorted()
15. Next Topics
Decorators
Generators
Async Programming
Web Development
Data Science