0% found this document useful (0 votes)
6 views3 pages

Python Crash Course

The document is a quick guide to Python programming for beginners and intermediates, covering essential topics such as variables, data types, loops, functions, and object-oriented programming. It includes examples of code for basic operations, input/output, and file handling. Additionally, it mentions advanced topics like decorators, generators, and applications in web development and data science.

Uploaded by

magbanuaraven08
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Python Crash Course

The document is a quick guide to Python programming for beginners and intermediates, covering essential topics such as variables, data types, loops, functions, and object-oriented programming. It includes examples of code for basic operations, input/output, and file handling. Additionally, it mentions advanced topics like decorators, generators, and applications in web development and data science.

Uploaded by

magbanuaraven08
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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

You might also like