The Text Spells โจ
Learning: print() and Strings
๐ The Story
You've just arrived at the Python Wizard Academy! To prove you're worthy of the title Apprentice Coder, you must master your first spell โ the legendary Text Spell. With it, you can make any words appear on any screen in the kingdom. No magic wand requiredโฆ just a keyboard! ๐ง
๐ก The Big Idea
In Python, print() is your megaphone. Any message you put inside the brackets will appear on the screen. Words inside quote marks ("like this") are called Strings โ they're the magical text scrolls of Python!
๐ฅ๏ธ Do This in PyCharm
-
1Open PyCharm and go to File โ Openโฆ. Navigate to the
kids-python-adventurefolder and click OK / Trust Project. -
2In the left panel (Project Explorer), double-click
chapter_1_magic_words.pyto open it in the editor. -
3Read the green comment lines at the top โ they're your quest briefing! Every line that starts with
#is a comment (Python ignores it; it's written for you). -
4Find the lines marked
# TODO. These are your challenges! Change the text inside the quotes to your own name and answers. Keep the" "marks exactly where they are! -
5Click the big green โถ Play button in the top-right corner (or press Shift + F10). Watch the magic happen in the Console below!
๐ What to Look For in PyCharm
At the bottom of your screen, a dark panel pops open โ that's the Run Console. It's like the display screen of your computer game. Look for:
- โ Your own name printed on a line by itself
- โ Your favorite animal and battle cry
- โ
A big decorative banner made of
โจsymbols - โ The message "CHAPTER 1 COMPLETE!"
๐ If you see your name in the Console โ you cast your FIRST Python spell!