Welcome, Little Coder! ๐ Are you ready to start your magical coding journey? With Python, you'll learn to speak to a computer, solve puzzles, build games, and even make your own smart magic!
This guide is your treasure map. It will take you from the first steps of Python all the way to becoming a Code Wizard!
Important Recommendation: To effectively understand this project, it is highly recommended to start by reading the .md files within each folder (e.g., 01_BASICS, 02_conditionals). These Markdown files provide detailed explanations for each chapter. After reviewing the .md file in a folder, proceed to explore the problems included within that folder. When instructed to go to a specific folder, such as in the "Try your own..." prompts, first navigate to that folder and open the .md file (e.g., guide.md or note.md) to understand the concepts. Then, open the problems.md file and attempt the challenges. Following this order will facilitate a comprehensive understanding of the project and maximize its benefits.
Each part of your adventure is like a level in a game:
- ๐ Read the Lesson โ Start here to learn the idea. Donโt worry if it feels new!
- ๐ง See the Magic โ Look at the simple code example and its step-by-step explanation.
- ๐ก๏ธ Do the Mini-Missions โ Inside the folders (like
01_BASICS), open theproblems.mdfile. Try the fun challenges! - ๐ง Check the Answers โ Solutions are in the same folder if you want to compare your spell with the masterโs spell.
๐ก You don't need to rush. Go slowly. Try one lesson each day. Thatโs how you grow strong and wise!
Before we begin, make sure youโre ready!
-
โ Install Python: Go to python.org/downloads. When installing, make sure you check โ โAdd Python to PATHโ.
-
๐ฅ๏ธ Pick a Code Editor:
- For grown-up kids: ๐ป VS Code โ powerful and used by many developers. We highly recommend VS Code. Download it from the official website: VS Code Download.
- For young kids: ๐ธ Thonny โ very simple and easy to use. Download it from thonny.org.
-
โ Creating and Using Python Files:
- Create a project folder (e.g.,
learning-python) on your Desktop or in a preferred drive. - Open VS Code and either open the project folder directly or drag the folder into VS Code.
- In VS Code, create a new file within the project folder (e.g.,
hello.py). Make sure the file ends with the.pyextension. - Write your Python code in the file.
- To run the file:
- In VS Code, right-click in the editor and select "Run Python File in Terminal".
- In Thonny, click the green "Run" button.
- Create a project folder (e.g.,
To watch the full video tutorial on YouTube, click here: Watch the Playlist
This is how we tell the computer to say something:
print("Hello, world!")๐ฌ The computer will say:
Hello, world!
Thatโs your first spell. Great job! ๐
Go to the 01_BASICS folder to learn more about data types. Remember to read the .md file first!
Imagine a magic bag with a label. You can store something in it and use it later.
player_name = "Luna"
player_score = 100
print(player_name) # Shows: Luna
print(player_score) # Shows: 100๐ช Variables are like pouches that remember your stuff!
| Name | Example | What It Means |
|---|---|---|
str (String) |
"hello" |
Words and text |
int (Integer) |
42 |
Whole numbers |
float |
3.14 |
Numbers with dots (decimals) |
bool (Boolean) |
True, False |
Yes/No, Light On/Off (1 or 0) |
These help you do math and make choices.
apples = 5
bananas = 3
total = apples + bananas
print(total) # Shows: 8Other cool tools:
| Symbol | Meaning | Example (5 vs 3) |
Result |
|---|---|---|---|
+ |
Add | 5 + 3 |
8 |
- |
Subtract | 5 - 3 |
2 |
* |
Multiply | 5 * 3 |
15 |
/ |
Divide | 5 / 3 |
1.67 |
== |
Are they equal? | 5 == 3 |
False |
!= |
Are they different? | 5 != 3 |
True |
Make your code think and choose:
age = 10
if age < 13:
print("You're a child wizard!")
else:
print("You're a teen wizard!")๐งช Try your own decision spells in 02_conditionals/problems.md.
Go to the 02_conditionals folder to learn more about conditionals. Remember to read the .md file first!
Loops help you repeat things many times.
for i in range(5):
print("๐ Magic!")
# Prints "Magic!" five times!Try the loop puzzles in 03_loops/problems.md.
Go to the 03_loops folder to learn more about loops. Remember to read the .md file first!
Python has some magic helpers in its itertools toolbox.
This chapter gives you extra strong loop powers!
๐ Start exploring in 04_iteration_tools/problems.md.
Go to the 04_iteration_tools folder to learn more about iteration tools. Remember to read the .md file first!
Functions are like your own magic recipes.
def greet(name):
print("Hello, " + name)
greet("Zara")๐ Build your own spellbook in 05_functions/problems.md.
Go to the 05_functions folder to learn more about functions. Remember to read the .md file first!
๐ Chapter 6: Hidden Treasures (Scope & Closure)
Learn about where variables live, and how some functions remember things.
This is a little tricky, but fun!
๐ง Try the brainy challenges in 06_scopes_and_clouser/problems.md.
Go to the 06_scopes_and_clouser folder to learn more about scope and closure. Remember to read the .md file first!
Use blueprints (classes) to make your own magic items (objects):
class Dragon:
def __init__(self, name):
self.name = name
firey = Dragon("Spark")
print(firey.name) # Shows: Spark๐ฐ Enter the land of dragons in 07_oop/problems.md.
Go to the 07_oop folder to learn more about OOP. Remember to read the .md file first!
Decorators add extra powers to your functions without changing their heart.
def sparkle(func):
def wrapper():
print("โจ")
func()
print("โจ")
return wrapper
@sparkle
def say_hi():
print("Hi there!")
say_hi()๐ฉ Cast your first decorator spells in 08_decorators/problems.md.
Go to the 08_decorators folder to learn more about decorators. Remember to read the .md file first!
remaining Python data types, logical operators, and a new bonus table of useful built-in functions/methods like range(), all presented in the same magical, kid-friendly tone:
Besides str, int, float, and bool, Python has magic containers to hold many things at once!
| Type | Example | What It Does |
|---|---|---|
list |
["apple", "banana", "cherry"] |
A list of items you can change |
tuple |
("red", "green", "blue") |
A list that cannot be changed |
set |
{"dragon", "elf", "wizard"} |
Like a bag of unique items |
dict |
{"name": "Luna", "age": 12} |
Stores items with key-value pairs |
fruits = ["apple", "banana", "cherry"] # List
colors = ("red", "green", "blue") # Tuple
animals = {"dragon", "elf", "wizard"} # Set
player = {"name": "Luna", "score": 99} # Dictionary
print(fruits[0]) # apple
print(colors[2]) # blue
print("elf" in animals) # True
print(player["score"]) # 99We already saw math operators like +, -, *, /, ==, !=.
Letโs now learn logical and membership operators!
| Operator | Meaning | Example | Result |
|---|---|---|---|
and |
Both must be true | True and True |
True |
or |
One must be true | True or False |
True |
not |
Flips the truth | not True |
False |
in |
Is it inside? | "a" in "cat" |
True |
not in |
Is it NOT inside? | "z" not in "cat" |
True |
is |
Are they the same thing? | a is b |
True/False |
is not |
Are they NOT the same thing? | a is not b |
True/False |
Here are some magic tools youโll use a lot:
| Function/Method | What It Does | Example | Result |
|---|---|---|---|
print() |
Shows something on the screen | print("Hi!") |
Hi! |
type() |
Tells the type of a value | type(5) |
<class 'int'> |
len() |
Counts how many items or letters | len("dragon") |
6 |
range() |
Makes a list of numbers to use in loops | range(5) |
0, 1, 2, 3, 4 |
str() |
Tells the type of a value | type("7") |
<class 'str'> |
int() |
Turns something into an integer | int("7") |
7 |
float() |
Turns something into a decimal | float("3.14") |
3.14 |
input() |
Asks the user for something | input("Name? ") |
(user types something) |
.append() |
Adds an item to a list | my_list.append("new") |
List gets a new item |
.pop() |
Removes and returns the last item from a list | x = my_list.pop() |
Removes last item |
.split() |
Splits a string into a list | "a,b,c".split(",") |
["a", "b", "c"] |
.join() |
Joins a list into a string | " ".join(["a", "b", "c"]) |
"a b c" |
.lower() / .upper() |
Changes string case | "Hi".lower() |
"hi" |
sorted() |
Sorts a list (without changing original) | sorted([3,1,2]) |
[1, 2, 3] |
sum() |
Adds up all numbers in a list | sum([1, 2, 3]) |
6 |
max() / min() |
Finds biggest/smallest number | max([3, 8, 2]) |
8 |
* (single asterisk) |
Spread for lists/iterables | [*list1, item1, item2] |
Creates new list |
** (double asterisk) |
Spread for dictionaries | {**dict1, key1: val1} |
Creates new dictionary |
*args |
Collects positional arguments in a function | def func(*args): |
Tuple of arguments |
**kwargs |
Collects keyword arguments in a function | def func(**kwargs): |
Dict of arguments |
You've finished the first journey! ๐ You're now a young code magician. But thereโs so much more to explore!
- ๐ฆ
pip install some_magicโ This adds new magic to your code! - ๐ Use Pythonโs built-in libraries like
math,random,datetime.
| Path | What You Can Build |
|---|---|
| ๐ Web Wizard | Make websites (Learn Flask, Django) |
| ๐ Data Sorcerer | Analyze data (Learn Pandas, NumPy) |
| ๐ค AI Tamer | Teach computers to think (Learn TensorFlow) |
| ๐น๏ธ Game Maker | Build games (Learn Pygame) |
| โ๏ธ Task Master | Automate boring stuff (Use Selenium) |
Remember, even the best coders started with baby steps.
- ๐ข Go slow. Itโs okay to forget. Repeat.
- ๐ง Practice is your real magic wand.
- ๐ Be curious. Ask โWhat happens if I try this?โ
- ๐ฉโ๐ซ Ask others. No wizard learns alone.
- Can you make a guessing game?
- Can you make a calculator?
- Can you make a pet dragon using classes?
โโโ 01_BASICS/
โโโ 02_conditionals/
โโโ 03_loops/
โโโ 04_iteration_tools/
โโโ 05_functions/
โโโ 06_scopes_and_clouser/
โโโ 07_oop/
โโโ 08_decorators/
โโโ 09_error_handling/ ๐ [Learn about error handling in Python](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/09_error_handling).
โโโ 10_terminal_YT_Manager_app_with_sqlite3/ ๐ฌ [Build a terminal-based YouTube manager app with SQLite](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/10_terminal_YT_Manager_app_with_sqlite3).
โโโ 11_api_handling_with_http_request/ ๐ก [Learn API handling with HTTP requests](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/11_api_handling_with_http_request).
โโโ 12_PYTHON_MONGODB/ ๐ [Explore MongoDB with Python](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/12_PYTHON_MONGODB).
โโโ 13_vertual_environment_py/ โ๏ธ [Learn about virtual environments in Python](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/13_vertual_environment_py).
โโโ 14_Open_Source_Code_of_Python/ ๐ก [Explore open source codebases in Python](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/14_Open_Source_Code_of_Python).
โโโ 15_conda/ ๐งช [Learn about Conda](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/15_conda).
โโโ 16_jupyter/ ๐ [Learn about Jupyter Notebooks](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/16_jupyter).
โโโ 17_farewell_of_python/ ๐ [Python career paths](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/17_farewell_of_python).
โโโ 18_Python_for_Js_developer (Optional)/ ๐ [Python for JavaScript Developers: Learn Python frameworks like FastAPI and Django](https://github.com/sayedatiqurrahman/Python_learning_path/tree/main/18_Python_for_Js_developer (Optional)).
Each one has:
* `README.md` โ Learn the lesson
* problems.md โ Practice
* solutions/ โ See examples from master coders
---
## ๐งโโ๏ธ Welcome to the World of Python
You're not just learning code โ you're **learning to think**, to build, and to dream.
Now go, little code sorcerer โ **the magic is in your hands!** โจ๐๐ช
---