Night 1: Wake up your pet
تحتاج هذه الصفحة إلى متصفح حديث (يدعم SharedArrayBuffer). يرجى تحديث Chrome أو Edge أو Firefox أو Safari إلى أحدث إصدار.
English
Tonight: make your pet talk
- Your pet is asleep in its egg. Tonight you wake it up.
- You will learn one thing:
print. - It takes about 10 minutes.
Words for tonight
| Word | Meaning |
|---|---|
| code | instructions for the computer |
| show words on the screen | |
| output | what the program shows |
English
print shows words
printtells Python: show this on the screen.- Put the words inside quotes
" ". - Put the quotes inside brackets
( ).
print("Hello!")
- Press Run. The output is
Hello!
English
One line, one print
- Each
printmakes a new line. - Python runs your code from top to bottom.
print("Good morning!")
print("I am a pet.")
print("I like code.")
English
Small mistakes
- Python is careful. Small mistakes stop the program.
Printwith a capital P does not work. Writeprint.- Every
"needs a partner". Every(needs a).
print("Spaces and capitals inside quotes are kept: A B C")
English
Now you try
- Do the tasks below. Press Run to see your output.
- Then press Check answer. Your pet wakes up when all tasks pass.
- The star task is extra. Try it if you have time.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Make your pet say I am awake! Use print(...). Copy the words exactly.
اضغط تشغيل لرؤية المخرجات هنا.
الصعوبة 1/5 · 100 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Your pet says three things, one per line: Hello!, then I am hungry., then Good night! Use three print(...) lines.
اضغط تشغيل لرؤية المخرجات هنا.
الصعوبة 2/5 · 140 عملة + مكافأة صغيرة عند الإنجاز الأول اليوم
Draw your pet's face with text. Print بالضبط these three lines:
/\_/\
( o.o )
> ^ <
Tip: inside quotes, write \\ to print one \.
اضغط تشغيل لرؤية المخرجات هنا.