A list of squares · רשימת ריבועים
A list of squares
Build a list one item at a time instead of printing each value.
squares.append(x) adds x to the end of the list. Printing a whole list shows it in square brackets, with commas between the items.
רשימת ריבועים
בנה רשימה פריט אחר פריט במקום להדפיץ כל ערך בנפרד.
squares.append(x) מוסיף x בסוף הרשימה. הדפסת רשימה שלמה מציגה אותה בסוגריים מרובעים, עם פסי פרידה בין הפריטים.
Start with an empty list, add the squares of 1 to 5 with .append(), then print the list. It should show [1, 4, 9, 16, 25]. · התחל ברשימה ריקה, הוסף את הריבועים של 1 עד 5 ב-.append(), ואז הדפס את הרשימה. היא צריכה להציג [1, 4, 9, 16, 25].
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.