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.
ברוך הבא
- Python מבצע את ההוראות שלך, שורה אחת בכל פעם.
- כאן תכתוב קוד ותפעיל אותו — אין צורך בהתקנה.
- קרא כל שלב, ולאחר מכן לחץ על 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).
מחרוזות
- טקסט בתוך פסיקתיים נקרא מחרוזת (string).
- ניתן להשתמש בפסיקתיים כפולות
"..."או פסיקתיים יחידות'...'. - ניתן הדפיס גם מספר ללא פסיקתיים, כמו
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.
הערות
- שורה המתחילה ב-
#היא הערה (comment). - Python מתעלמת מהערות — הן אינן מתבצעות.
- השתמש בהן כדי להשאיר הערות לאנשים שקוראים את הקוד שלך.
# 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).- Python רגיש לתחביר האותיות:
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. · לחץ על הרץ כדי לראות את התוצא כאן.