Your first program · برنامجك الأول
Welcome
- Python follows your instructions, one line at a time.
- You write code here and run it — nothing to install.
- Read each step, then press Continue.
مرحبًا بك
- بايثون يتبع تعليماتك، سطرًا تلو الآخر.
- تكتب الكود هنا وتشغله — لا حاجة للتثبيت.
- اقرأ كل خطوة، ثم اضغط متابعة.
Show text with print
print(...)shows text on the screen.- Put the text in quotes:
"...". - Each
printstarts a new line.
عرض نص باستخدام print
print(...)يعرض نصًا على الشاشة.- ضع النص بين علامتي تنصيص:
"...". - كل
printيبدأ سطرًا جديدًا.
print("Welcome to Python!")
print("This line runs next.")
Strings
- Text in quotes is called a string.
- You can use double quotes
"..."or single quotes'...'. - You can also print a number with no quotes, like
print(42).
السلاسل النصية
- النص المحاط بعلامات التنصيص يسمى سلسلة نصية.
- يمكنك استخدام علامات تنصيص مزدوجة
"..."أو مفردة'...'. - يمكنك أيضًا طباعة رقم بدون علامات تنصيص، مثل
print(42).
Comments
- A line that starts with
#is a comment. - Python ignores comments — they do not run.
- Use them to leave notes for people who read your code.
التعليقات
- السطر الذي يبدأ بـ
#هو تعليق. - بايثون يتجاهل التعليقات — فهي لا تُنفَّذ.
- استخدمها لترك ملاحظات للأشخاص الذين يقرؤون كودك.
# This line is a note for people. Python skips it.
print("Comments do not show.")
Common mistakes
printneeds quotes around text:print("Hi"), notprint(Hi).- Python is case-sensitive:
Printis not the same asprint.
أخطاء شائعة
printيحتاج علامات تنصيص حول النص:print("Hi")، وليسprint(Hi).- بايثون حساس لحالة الأحرف:
Printليست هي نفسهاprint.
Now you try
- Below are a few tasks. Type your code and press Run.
- Press Check answer to see if it is correct.
الآن جرب بنفسك
- أدناه بعض المهام. اكتب كودك واضغط تشغيل.
- اضغط تحقق من الإجابة لترى ما إذا كانت صحيحة.
How a program runs · كيف يعمل البرنامج
A program runs top to bottom, one statement at a time. · يعمل البرنامج من الأعلى إلى الأسفل، تعليمةً تلو الأخرى.
Use print(...) to make Python show the words Hello, world! exactly (same spelling, same punctuation). · استخدم print(...) لجعل بايثون يعرض كلمة Hello, world! حرفياً (نفس الإملاء ونفس علامات الترقيم).
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
Print two lines. The first line must be My name is Pat. The second line must be I am learning Python. (Use two print(...) calls.) · اطبع سطرين. يجب أن يكون السطر الأول My name is Pat. والسطر الثاني I am learning Python. (استدعِ print(...) مرتين).
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
Keep the comment line, then print the number 42. Notice the comment never appears in the output. · احتفظ بسطر التعليق، ثم print الرقم 42. لاحظ أن التعليق لا يظهر أبداً في المخرجات.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
Print a box made of three lines: first +-----+, then | Hi! |, then +-----+ again. · اطبع مربعاً مكوناً من ثلاثة أسطر: أولاً +-----+، ثم | Hi! |، ثم +-----+ مرة أخرى.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.