נבנה על ידיBuilt by Ariel Yohimovich

PythonPython
3
חלקPart 1: יסודותFoundations כ-3 שעות (כולל הפסקה)About 3 hours (with a break)

טיפוסים ומספריםTypes & numbers

int, float, bool, המרות בין טיפוסים, עיגול, ומה קורה כשמערבבים.

int, float, bool, converting between types, rounding, and what happens when you mix them.

נסו לפתור לבד לפני שמציצים. בנגן: חיצים במקלדת או הכפתורים. כל צעד מראה איפה (קובץ ושורה), מה כותבים ולמה.Try on your own before peeking. In the player use the arrow keys or the buttons. Each step shows where (file and line), what to write, and why.
תרגילExercise 1

גיל בעוד 10 שניםAge in 10 years

תזכורת: מה ביקשוReminder: the task

קלטו גיל והדפיסו את הגיל בעוד 10 שנים.

Read an age and print the age in 10 years.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
age = int(input("גיל: "))
print(age + 10)
age = int(input("Age: "))
print(age + 10)
פלטOutput
גיל: 31
41
Age: 31
41

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

תרגילExercise 2

צלזיוס לפרנהייטCelsius to Fahrenheit

תזכורת: מה ביקשוReminder: the task

קלטו טמפרטורה בצלזיוס (יכולה להיות עשרונית) והדפיסו בפרנהייט, מעוגל לספרה אחת אחרי הנקודה. נוסחה: F = C × 9/5 + 32.

Read a Celsius temperature (may be a decimal) and print it in Fahrenheit, rounded to one decimal. Formula: F = C × 9/5 + 32.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
c = float(input("°C: "))
f = c * 9 / 5 + 32
print(round(f, 1))
פלטOutput
°C: 36.6
97.9

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

תרגילExercise 3

בלש טיפוסיםType detective

תזכורת: מה ביקשוReminder: the task

הדפיסו את הטיפוס של ארבעה ערכים: 12, 12.0, "12" ו-12 > 5, כל אחד בשורה.

Print the type of four values: 12, 12.0, "12" and 12 > 5, one per line.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
print(type(12))
print(type(12.0))
print(type("12"))
print(type(12 > 5))
פלטOutput
<class 'int'>
<class 'float'>
<class 'str'>
<class 'bool'>

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

תרגילExercise 4

חלוקת חשבוןSplit the bill

תזכורת: מה ביקשוReminder: the task

קלטו סכום חשבון ומספר סועדים. הדפיסו כמה כל אחד משלם, עם בדיוק 2 ספרות אחרי הנקודה.

Read a bill total and a number of diners. Print each person's share with exactly 2 decimals.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
total = float(input("סכום: "))
people = int(input("סועדים: "))
share = total / people
print(f"{share:.2f}")
total = float(input("Total: "))
people = int(input("Diners: "))
share = total / people
print(f"{share:.2f}")
פלטOutput
סכום: 250
סועדים: 3
83.33
Total: 250
Diners: 3
83.33

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

תרגילExercise 5

מדף, צעד 3: אחוז התקדמותShelf, step 3: reading progress

תזכורת: מה ביקשוReminder: the task

קלטו כמה עמודים יש בספר וכמה קראתם. הדפיסו את אחוז ההתקדמות כמספר שלם (מעוגל) ואחריו %, וגם כמה ימים נשארו בקצב של 20 עמודים ביום (מעוגל למעלה).

Read a book's total pages and pages read. Print the progress as a whole percent followed by %, and how many days are left at 20 pages a day (rounded up).

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
shelf.py
import math
pages = int(input("עמודים בספר: "))
read = int(input("קראתי: "))
percent = round(read / pages * 100)
days = math.ceil((pages - read) / 20)
print(f"{percent}%")
print(f"ימים שנשארו: {days}")
import math
pages = int(input("Total pages: "))
read = int(input("Pages read: "))
percent = round(read / pages * 100)
days = math.ceil((pages - read) / 20)
print(f"{percent}%")
print(f"Days left: {days}")
פלטOutput
עמודים בספר: 412
קראתי: 103
25%
ימים שנשארו: 16
Total pages: 412
Pages read: 103
25%
Days left: 16

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

אתגרChallenge 1

שניות לשעוןSeconds to clock

תזכורת: מה ביקשוReminder: the task

קלטו מספר שניות והדפיסו בפורמט H:MM:SS, למשל 3725 → 1:02:05.

Read a number of seconds and print it as H:MM:SS, e.g. 3725 → 1:02:05.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
total = int(input())
h = total // 3600
m = total % 3600 // 60
s = total % 60
print(f"{h}:{m:02d}:{s:02d}")
פלטOutput
3725
1:02:05

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

אתגרChallenge 2

ריבית דריביתCompound interest

תזכורת: מה ביקשוReminder: the task

קלטו סכום ואחוז ריבית שנתי. הדפיסו את הסכום אחרי 3 שנים של ריבית דריבית, מעוגל ל-2 ספרות. נוסחה: סכום × (1 + ריבית/100) בחזקת 3.

Read an amount and an annual interest percent. Print the amount after 3 years of compound interest, rounded to 2 places. Formula: amount × (1 + rate/100) to the power of 3.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
main.py
amount = float(input())
rate = float(input())
final = amount * (1 + rate / 100) ** 3
print(round(final, 2))
פלטOutput
1000
5
1157.63

יש יותר מדרך נכונה אחת. אם הפלט שלכם זהה, גם הפתרון שלכם נכון.There is more than one right way. If your output matches, your solution is right too.

נבנה על ידיBuilt by Ariel Yohimovich