0% found this document useful (0 votes)
1 views2 pages

Python Roadmap and CheatSheet

The document provides a comprehensive roadmap for beginners to learn Python, covering essential topics such as installation, basic syntax, data structures, functions, and object-oriented programming. It also includes a cheat sheet with quick references for common concepts and code examples. This guide serves as a foundational resource for new Python learners to build their programming skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views2 pages

Python Roadmap and CheatSheet

The document provides a comprehensive roadmap for beginners to learn Python, covering essential topics such as installation, basic syntax, data structures, functions, and object-oriented programming. It also includes a cheat sheet with quick references for common concepts and code examples. This guide serves as a foundational resource for new Python learners to build their programming skills.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Roadmap for Beginners + Cheat Sheet

1. Introduction to Python
- What is Python?
- Installing Python (via python.org or Anaconda)
- Running Python scripts: IDLE, VS Code, Jupyter, Terminal
2. Basic Syntax
- print(), comments (#)
- Variables and Data Types: int, float, str, bool
- Type conversion: str(), int(), float()
3. Operators
- Arithmetic: + - * / // % **
- Comparison: == != > < >= <=
- Logical: and, or, not
- Assignment: = += -=
4. Conditional Statements
if condition:
# code
elif another_condition:
# code
else:
# code
5. Loops
# while loop
while condition:
# code

# for loop
for i in range(5):
# code
6. Data Structures
- List: [], methods: .append(), .remove()
- Tuple: (), immutable
- Set: {}, unique values
- Dictionary: {"key": "value"}
7. Functions
def function_name(params):
return result
8. Modules and Packages
- import math
- from datetime import datetime
9. File Handling
with open("file.txt", "r") as file:
content = file.read()
10. Exception Handling
try:
# code
except Exception as e:
print(e)
11. Object-Oriented Programming (OOP)
class Person:
def __init__(self, name):
self.name = name
Python Cheat Sheet (Quick Reference)
| Concept | Example |
|---------------|----------------------------------|
| Print | print("Hello, World") |
| Variable |x=5 |
| List | mylist = [1, 2, 3] |
| If-else | if x > 5: |
| For loop | for i in range(5): |
| Function | def add(a, b): return a + b |
| Dictionary | {"name": "Ana"} |
| Input | input("Enter: ") |
| String format | f"Name: {name}" |
| Import | import math |

You might also like