משתנים, print ו-inputVariables, print & input
משתנים כתוויות על ערכים, קלט מהמשתמש, f-strings ראשונים.
Variables as labels on values, user input, first f-strings.
ברכה אישיתPersonal greeting
תזכורת: מה ביקשוReminder: the task
קלטו שם עם input והדפיסו שלום, <שם>! (באנגלית: Hello, <name>!). השתמשו ב-f-string.
Read a name with input and print Hello, <name>!. Use an f-string.
הפתרון המלא והפלט שלוFull solution and its output
name = input("מה שמך? ")
print(f"שלום, {name}!")name = input("Your name? ")
print(f"Hello, {name}!")מה שמך? Dana שלום, Dana!
Your name? Dana Hello, Dana!
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
החלפת ערכיםSwap values
תזכורת: מה ביקשוReminder: the task
נתונים a = 7 ו-b = 3. החליפו ביניהם כך שבסוף a הוא 3 ו-b הוא 7, והדפיסו את שניהם.
Given a = 7 and b = 3, swap them so that a is 3 and b is 7, then print both.
הפתרון המלא והפלט שלוFull solution and its output
a = 7
b = 3
a, b = b, a
print(a, b)3 7
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
כרטיס היכרותIntro card
תזכורת: מה ביקשוReminder: the task
קלטו שם ועיר (שתי שאלות), והדפיסו שתי שורות: שם: ... ו-עיר: ....
Read a name and a city (two questions) and print two lines: Name: ... and City: ....
הפתרון המלא והפלט שלוFull solution and its output
name = input("שם: ")
city = input("עיר: ")
print(f"שם: {name}")
print(f"עיר: {city}")name = input("Name: ")
city = input("City: ")
print(f"Name: {name}")
print(f"City: {city}")שם: Noa עיר: Eilat שם: Noa עיר: Eilat
Name: Noa City: Eilat Name: Noa City: Eilat
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
תאריך עם sepA date with sep
תזכורת: מה ביקשוReminder: the task
משתנים day = 19, month = 11, year = 2026. הדפיסו בשורה אחת 19/11/2026 בעזרת sep, בלי לכתוב / בתוך מחרוזת אחרת.
Variables day = 19, month = 11, year = 2026. Print 19/11/2026 on one line using sep, without writing / in any other string.
הפתרון המלא והפלט שלוFull solution and its output
day = 19
month = 11
year = 2026
print(day, month, year, sep="/")19/11/2026
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
מדף, צעד 2: ספר מהמשתמשShelf, step 2: a book from the user
תזכורת: מה ביקשוReminder: the task
שאלו את המשתמש על שם ספר ועל המחבר, והדפיסו כרטיס: קו, 📚 <שם>, ✍️ <מחבר>, קו. שמרו כל ערך במשתנה עם שם טוב.
Ask the user for a book title and author, and print a card: a line, 📚 <title>, ✍️ <author>, a line. Keep each value in a well-named variable.
הפתרון המלא והפלט שלוFull solution and its output
title = input("שם הספר: ")
author = input("מחבר: ")
print("--------------------")
print(f"📚 {title}")
print(f"✍️ {author}")
print("--------------------")title = input("Book title: ")
author = input("Author: ")
print("--------------------")
print(f"📚 {title}")
print(f"✍️ {author}")
print("--------------------")שם הספר: Dune מחבר: Frank Herbert -------------------- 📚 Dune ✍️ Frank Herbert --------------------
Book title: Dune Author: Frank Herbert -------------------- 📚 Dune ✍️ Frank Herbert --------------------
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
סיפור משוגעMad-libs story
תזכורת: מה ביקשוReminder: the task
קלטו שלוש מילים: חיה, צבע, מקום. הדפיסו משפט אחד שמשלב את שלושתן בסדר הזה, למשל ראיתי זברה סגולה בירושלים.
Read three words: an animal, a colour, a place. Print one sentence using all three in that order, e.g. I saw a purple zebra in Paris.
הפתרון המלא והפלט שלוFull solution and its output
animal = input("חיה: ")
color = input("צבע: ")
place = input("מקום: ")
print(f"ראיתי {animal} {color} ב-{place}")animal = input("Animal: ")
color = input("Colour: ")
place = input("Place: ")
print(f"I saw a {animal} {color} in {place}")חיה: zebra צבע: purple מקום: Paris ראיתי zebra purple ב-Paris
Animal: zebra Colour: purple Place: Paris I saw a zebra purple in Paris
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.
סיבוב שלושהRotate three
תזכורת: מה ביקשוReminder: the task
a, b, c = 1, 2, 3. בשורה אחת בלבד, סובבו כך ש-a יקבל את הערך של b, b של c ו-c של a. הדפיסו 2 3 1.
a, b, c = 1, 2, 3. In a single line, rotate so a gets b's value, b gets c's and c gets a's. Print 2 3 1.
הפתרון המלא והפלט שלוFull solution and its output
a, b, c = 1, 2, 3
a, b, c = b, c, a
print(a, b, c)2 3 1
יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.