Ada and the Magic Loop πͺ
Ada wanted to draw 10 stars. Instead of drawing them one by one, she used a magic `for` loop! The loop repeated the star-drawing spell 10 times instantly. β¨
Lesson: Loops make life easier by automating repetitive tasks!
Notes & Practice for Kβ12 Coders
Learn coding one concept at a time.
π‘ Tip of the Day: Bugs are part of learning β donβt be afraid to fix them!
A variable is like a box that stores something. You give it a name and put a value in it.
x = 10
print(x)
Q: What does x = 10 mean?
β C) It stores 10 in x
If/Else helps your program choose what to do based on conditions.
age = 12
if age > 10:
print("You're older than 10!")
else:
print("You're 10 or younger.")
Q: What will this print if age = 12?
β C) You're older than 10!
Loops let your program repeat actions to save time.
for i in range(3):
print("Hi!")
Q: How many times will "Hi!" be printed?
β B) 3
An array (or list in Python) stores multiple values in one place β like a basket of fruits.
fruits = ["apple", "banana", "cherry"]
print(fruits[1]) # Accessing the second item (index 1)
Q: What will this print?
β B) banana
A function is like a mini-program you can call anytime to perform a specific task.
def greet():
print("Hello!")
greet() # Calling the function
Q: What will this print?
β C) Hello!
Try these challenges on your own! You can use an online Python editor like Replit.
Ada wanted to draw 10 stars. Instead of drawing them one by one, she used a magic `for` loop! The loop repeated the star-drawing spell 10 times instantly. β¨
Lesson: Loops make life easier by automating repetitive tasks!
Leo had a list of his favorite toys: `toys = ["robot", "car", "block"]`. He wanted the car, but forgot where it was! He remembered lists start counting from 0, so the car was at index 1: `toys[1]`. π
Lesson: Arrays (lists) help you store and find many items easily!
Everyone makes mistakes (bugs!) in code. Here's how to find and fix them:
: at the end of lines starting with if, else, for, def.== to compare if two things are equal (e.g., if age == 10:). A single equals = is for assigning values to variables.print() statements inside your code to see the values of variables at different points. This helps track down where things go wrong.Celebrate your coding milestones!
ποΈ Junior Python Pro!
(Complete all topics to earn)Write your own notes here!
(This is a visual section only - notes are not saved.)
Check off the concepts you've learned:
π Youβve completed the CodeCrate basics!
Your feedback helps us make CodeCrate better!
Please share your thoughts using our feedback form:
Give Feedback