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

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

מה זה תכנות? התקנה וטרמינלWhat is programming? Setup & terminal

איך מחשב מבצע הוראות, התקנת Python ו-VS Code ב-Windows וב-Mac, הטרמינל, והתוכנית הראשונה עם print.

How a computer follows instructions, installing Python and VS Code on Windows and Mac, the terminal, and a first program with print.

נסו לפתור לבד לפני שמציצים. בנגן: חיצים במקלדת או הכפתורים. כל צעד מראה איפה (קובץ ושורה), מה כותבים ולמה.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

בונים את תיקיית הקורסSet up the course folder

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

במחשב שלכם, בטרמינל אמיתי: צרו על שולחן העבודה תיקייה בשם python-course, היכנסו אליה, צרו בה קובץ hello.py (דרך VS Code) עם השורה print("Hi"), והריצו אותו מהטרמינל.

On your own computer, in a real terminal: create a folder named python-course on the Desktop, go into it, create hello.py in it (with VS Code) containing print("Hi"), and run it from the terminal.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
Terminal
cd Desktop
mkdir python-course
cd python-course
# כאן יוצרים את hello.py ב-VS Code
python3 hello.py
cd Desktop
mkdir python-course
cd python-course
# create hello.py in VS Code here
python3 hello.py

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

תרגילExercise 2

שלום, עולם (בגרסה שלכם)Hello, world (your version)

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

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

Write a program that prints two lines: a greeting with your name, and a sentence about something you love.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("שלום, אני נועה!")
print("אני אוהבת פיצה וטיולים")
print("Hi, I am Noa!")
print("I love pizza and hiking")
פלטOutput
שלום, אני נועה!
אני אוהבת פיצה וטיולים
Hi, I am Noa!
I love pizza and hiking

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

תרגילExercise 3

כרטיס ביקורBusiness card

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

הדפיסו כרטיס ביקור של 5 שורות לפחות: קו עליון, שם, תפקיד (למשל "מתכנת/ת Python מתחיל/ה"), אימייל, וקו תחתון. הוסיפו הערה אחת עם # שמסבירה מה התוכנית עושה.

Print a business card of at least 5 lines: a top border, a name, a role (e.g. "Beginner Python developer"), an email, and a bottom border. Add one # comment explaining what the program does.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("-------------------------")
print("נועה לוי")
print("מפתחת Python מתחילה")
print("noa@example.com")
print("-------------------------")
# Prints a business card
print("-------------------------")
print("Noa Levi")
print("Beginner Python developer")
print("noa@example.com")
print("-------------------------")
פלטOutput
-------------------------
נועה לוי
מפתחת Python מתחילה
noa@example.com
-------------------------
-------------------------
Noa Levi
Beginner Python developer
noa@example.com
-------------------------

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

תרגילExercise 4

ציור ASCIIASCII art

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

ציירו בפלט חתול, בית או רובוט, בעזרת תווים רגילים בלבד. לפחות 5 שורות.

Draw a cat, a house or a robot in the output, using plain characters only. At least 5 lines.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("  /\\_/\\  ")
print(" ( o.o ) ")
print("  > ^ <  ")
print(" /     \\ ")
print("(_______)")
פלטOutput
  /\_/\  
 ( o.o ) 
  > ^ <  
 /     \ 
(_______)

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

תרגילExercise 5

מחשבון זמניםTime calculator

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

הדפיסו, עם כיתוב ברור, כמה שעות יש בשבוע וכמה דקות יש ביממה. Python צריכה לחשב, לא אתם!

Print, with clear labels, how many hours are in a week and how many minutes are in a day. Let Python calculate, not you!

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("שעות בשבוע:", 7 * 24)
print("דקות ביממה:", 24 * 60)
print("Hours in a week:", 7 * 24)
print("Minutes in a day:", 24 * 60)
פלטOutput
שעות בשבוע: 168
דקות ביממה: 1440
Hours in a week: 168
Minutes in a day: 1440

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

תרגילExercise 6

צייד באגיםBug hunter

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

בקוד הזה יש 3 באגים. הריצו, קראו כל הודעת שגיאה, תקנו אחד-אחד עד שהתוכנית מדפיסה 3 שורות.

This code has 3 bugs. Run it, read each error, fix them one by one until the program prints 3 lines.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("מתחילים!")
print("2 * 21 =", 2 * 21)
print("סוף")
print("Let's go!")
print("2 * 21 =", 2 * 21)
print("The end")
פלטOutput
מתחילים!
2 * 21 = 42
סוף
Let's go!
2 * 21 = 42
The end

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

תרגילExercise 7

קבלה מהמכולתGrocery receipt

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

קניתם 2 כיכרות לחם ב-8 ₪, 3 חלב ב-6 ₪ וגבינה אחת ב-12.5 ₪. הדפיסו קבלה: שורה לכל מוצר עם המחיר הכולל שלו, ובסוף שורת סה״כ. כל החישובים ב-Python.

You bought 2 loaves of bread at 8, 3 milks at 6 and one cheese at 12.5. Print a receipt: a line per product with its total price, and a final total line. All maths in Python.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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("לחם:", 2 * 8)
print("חלב:", 3 * 6)
print("גבינה:", 1 * 12.5)
print("----------")
print("סה״כ:", 2 * 8 + 3 * 6 + 12.5)
print("Bread:", 2 * 8)
print("Milk:", 3 * 6)
print("Cheese:", 1 * 12.5)
print("----------")
print("Total:", 2 * 8 + 3 * 6 + 12.5)
פלטOutput
לחם: 16
חלב: 18
גבינה: 12.5
----------
סה״כ: 46.5
Bread: 16
Milk: 18
Cheese: 12.5
----------
Total: 46.5

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

תרגילExercise 8

מדף, צעד 1: באנר וספר ראשוןShelf, step 1: banner and first book

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

זה הצעד הראשון בפרויקט שילווה אתכם כל הקורס. צרו את shelf.py שמדפיס: באנר עם שם האפליקציה, פרטים של ספר אחד שאתם אוהבים (שם, מחבר, מספר עמודים), ושורה "ספרים במדף: 1". בערך 10 שורות.

This is the first step of the project that accompanies you through the course. Create shelf.py that prints: a banner with the app name, details of one book you like (title, author, page count), and a line "Books on the shelf: 1". About 10 lines.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.An animated movie: what to click, what to type and why, step by step.
איפהWhere
מהWhat
למהWhy
הפתרון המלא והפלט שלוFull solution and its output
shelf.py
print("==============================")
print("📚 מדף: הספרייה שלי")
print("==============================")
print()
print("ספר ראשון:")
print("  שם: הנסיך הקטן")
print("  מחבר: אנטואן דה סנט-אכזופרי")
print("  עמודים:", 96)
print()
print("ספרים במדף:", 1)
print("==============================")
print("📚 Shelf: my library")
print("==============================")
print()
print("First book:")
print("  Title: The Little Prince")
print("  Author: Antoine de Saint-Exupéry")
print("  Pages:", 96)
print()
print("Books on the shelf:", 1)
פלטOutput
==============================
📚 מדף: הספרייה שלי
==============================

ספר ראשון:
  שם: הנסיך הקטן
  מחבר: אנטואן דה סנט-אכזופרי
  עמודים: 96

ספרים במדף: 1
==============================
📚 Shelf: my library
==============================

First book:
  Title: The Little Prince
  Author: Antoine de Saint-Exupéry
  Pages: 96

Books on the shelf: 1

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

אתגרChallenge 1

שעות ודקותHours and minutes

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

סרט ארוך 1000 דקות (סדרה שלמה בבינג'!). בלי לחשב בראש, הדפיסו כמה שעות שלמות זה וכמה דקות נשארות, בשורה אחת, למשל: 16 שעות ו-40 דקות.

A binge-watch is 1000 minutes long. Without doing the maths yourself, print how many whole hours that is and how many minutes remain, on one line, e.g. 16 hours and 40 minutes.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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(1000 // 60, "שעות ו-", 1000 % 60, "דקות")
print(1000 // 60, "hours and", 1000 % 60, "minutes")
פלטOutput
16 שעות ו- 40 דקות
16 hours and 40 minutes

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

אתגרChallenge 2

פירמידת המספריםThe number pyramid

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

הדפיסו 5 שורות: 1 * 1, 11 * 11, 111 * 111 וכן הלאה עד 11111 * 11111. רק ש-Python תחשב! מה מיוחד בתוצאות? כתבו את התשובה בהערה בסוף הקוד.

Print 5 lines: 1 * 1, 11 * 11, 111 * 111 and so on up to 11111 * 11111. Let Python calculate! What's special about the results? Write the answer as a comment at the end of the code.

סרטון מונפש: על מה לוחצים, מה כותבים ולמה, צעד אחר צעד.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(1 * 1)
print(11 * 11)
print(111 * 111)
print(1111 * 1111)
print(11111 * 11111)
# כל תוצאה היא פלינדרום: עולה עד מספר האחדות ויורדת חזרה
print(1 * 1)
print(11 * 11)
print(111 * 111)
print(1111 * 1111)
print(11111 * 11111)
# each result is a palindrome: it counts up to the number of ones and back down
פלטOutput
1
121
12321
1234321
123454321
1
121
12321
1234321
123454321

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

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