๐Ÿช„
Preparing the Magic...
Loading Python spellbook
โญ
0
House Points
Theme
๐ŸŒ™

Your Magical Journey

Complete lessons to earn House Points and unlock new spells!

โ† Back to Lessons
Lesson +10 โญ
โœจ Your Spell (Code)
๐Ÿ“œ Magical Output

๐ŸŽ‰ Spell Cast Successfully!

You've mastered this magic!

+10 โญ
โ† Back to Lessons
Wand Drawing
โœจ Drawing Spell
๐ŸŽจ Magical Canvas

๐Ÿง™โ€โ™‚๏ธ Free Practice Chamber

Practice any spell you've learned! This is your space to experiment and create.

โœจ Your Spell
๐Ÿ“œ Output

๐Ÿ“– The Python Spellbook

A reference of all the magical spells (code) you'll learn

๐Ÿ”ฎ Basic Incantations

print("message")

Makes words appear magically! Like casting Illuminate to reveal text.

input("question")

Asks the wizard (user) a question and remembers their answer.

๐Ÿ“ฆ Magical Containers (Variables)

name = "Luna"

Stores a piece of text (called a "string") in a magical container.

age = 11

Stores a number in a container. Numbers don't need quotes!

๐Ÿงฎ Arithmancy (Maths)

+ - * /

Add, subtract, multiply, and divide numbers.

**

Powers! Like 2**3 means 2ร—2ร—2 = 8

๐ŸŽญ The Magic Hat (Decisions)

if condition:

Do something only IF a condition is true.

else:

Do something different if the condition was false.

elif condition:

Check another condition (short for "else if").

๐Ÿ”„ Time-Turner (Loops)

for i in range(5):

Repeat something a certain number of times (5 times here).

for item in list:

Go through each thing in a list, one by one.

while condition:

Keep repeating while something is true.

๐Ÿ“š Magical Lists

creatures = ["dragon", "phoenix", "hippogriff"]

A list holds multiple items in order.

creatures[0]

Get the first item (counting starts at 0!).

creatures.append("unicorn")

Add a new item to the end of a list.

โœจ Creating Your Own Spells (Functions)

def spell_name():

Create a new spell you can use again and again!

def greet(name):

A spell that takes an ingredient (parameter).

return value

Send back a result from your spell.

๐Ÿ† Your Achievements

Earn badges by completing lessons and mastering spells!

0
Total House Points
0
Lessons Completed
0
Spells Cast