Run it! · شغله!
Start here
- A lesson is a list of short steps. Press Continue (the arrow at the bottom) for the next one.
- After the steps come tasks: code you change and run.
- Today you type very little. You change one small thing at a time.
ابدأ من هنا
- الدرس عبارة عن قائمة من الخطوات القصيرة. اضغط متابعة (السهم في الأسفل) للانتقال إلى الخطوة التالية.
- بعد الخطوات تأتي المهام: كود تقوم بتعديله وتشغيله.
- اليوم تكتب القليل جدًا. تقوم بتغيير شيء صغير واحد في كل مرة.
The buttons
- Run ▶ runs the code. What it prints appears in the dark box under it.
- Check answer tests your code. Green means correct, and you win coins.
- The lightbulb gives a hint when you are stuck.
- Reset brings the starting code back.
الأزرار
- تشغيل ▶ يُشغّل الكود. ما يطبعه يظهر في الصندوق الداكن أسفله.
- تحقق من الإجابة يختبر كودك. اللون الأخضر يعني أن الإجابة صحيحة، وتحصل على عملات.
- المصباح يعطي تلميحًا عندما تكون عالقًا.
- إعادة تعيين يُعيد الكود الأصلي للبدء.
print("I am an example. Press the play button to run me.")
When something goes wrong
- If the code has a mistake, Python stops and shows red text.
- Under the red text, a card explains the error in English and Chinese and tells you which line to look at.
- Mistakes are normal. Read the card, fix one thing, and run again.
عندما يحدث خطأ ما
- إذا كان الكود يحتوي على خطأ، يتوقف بايثون ويعرض نصًا أحمر.
- تحت النص الأحمر، تظهر بطاقة تشرح الخطأ باللغتين الإنجليزية والصينية وتخبرك أي سطر تنظر إليه.
- الأخطاء أمر طبيعي. اقرأ البطاقة، صحح شيئًا واحدًا، ثم شغل الكود مرة أخرى.
When a program waits for you
- Some programs ask a question with
input(). - Then a highlighted box appears: type here, then press Enter.
- Click the box, type your answer and press Enter. The program continues.
عندما ينتظر البرنامج منك شيئًا
- بعض البرامج تطرح سؤالًا باستخدام
input(). - بعدها يظهر صندوق مظلّل: اكتب هنا، ثم اضغط Enter.
- انقر على الصندوق، اكتب إجابتك واضغط Enter. يستمر البرنامج.
name = input("What is your name? ")
print("Nice to meet you, " + name)
Now you try
- Three small tasks. Change the code, press Run, then Check answer.
الآن جرب بنفسك
- ثلاث مهام صغيرة. عدّل الكود، اضغط تشغيل، ثم تحقق من الإجابة.
This program is switched off: the # at the start makes the line a comment, so Python skips it. Delete the #, press Run ▶ to see what it prints, then press Check answer. · هذا البرنامج معطل: الـ # في البداية يجعل السطر تعليقاً، لذا يتخطاه بايثون. احذف #، ثم اضغط Run ▶ لترى ما يطبعه، وبعدها اضغط Check answer.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
Change one word so the program prints I like dogs. Only the text inside the quotes changes. · غيّر كلمة واحدة بحيث يطبع البرنامج I like dogs. يتغير فقط النص داخل علامات الاقتباس.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
This program has a mistake. Press Run ▶ first and read the card under the red text: it explains the error. Then fix the line so the program prints Hello. · يوجد خطأ في هذا البرنامج. اضغط Run ▶ أولاً واقرأ البطاقة تحت النص الأحمر: فهي تشرح الخطأ. ثم صحّ السطر لكي يطبع البرنامج Hello.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.