Creating, adding, removing, sorting, and what mutable means.
כותבים בעורך שבכל תרגיל, לוחצים הרצה כדי לראות פלט, ובדיקה כדי שהבודק האוטומטי יבדוק. אפשר גם לעבוד ב-VS Code. ההתקדמות נשמרת.Write in each exercise's editor, press Run to see output and Check for the automatic checker. You can also work in VS Code. Progress is saved.
חימום: 3 שאלותWarm-up: 3 questions
תרגיליםExercises
תרגילExercise 1
ממוצע ציוניםAverage score
נתונה הרשימה scores = [88, 92, 79, 95, 70]. הדפיסו את הממוצע מעוגל לספרה אחת, ואת הציון הגבוה והנמוך.
Given scores = [88, 92, 79, 95, 70], print the average rounded to one decimal, then the highest and lowest score.
איך הפלט אמור להיראות?What should the output look like?
מדף, צעד 7: רשימת ספרים אמיתיתShelf, step 7: a real list of books
פרויקט מלווהCompanion project
שדרגו את התפריט: 1 מוסיף שם ספר לרשימה, 2 מדפיס את כל הספרים ממוספרים (1. Dune), 3 מוחק ספר לפי שם (אם הוא קיים, אחרת not found), q יוצא.
Upgrade the menu: 1 adds a title to a list, 2 prints all books numbered (1. Dune), 3 removes a book by title (if it exists, otherwise not found), q quits.
איך הפלט אמור להיראות?What should the output look like?
> 1
title: Dune
> 1
title: Emma
> 2
1. Dune
2. Emma
> 3
remove: Ulysses
not found
> 3
remove: Dune
> q
shelf.py
רמזHint 1:shelf = [] לפני הלולאה.shelf = [] before the loop.
רמזHint 2:enumerate(shelf, start=1) להדפסה.enumerate(shelf, start=1) for printing.