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 ไปที่ท้ายรายการ. การพิมพ์รายการทั้งชุดจะแสดง它在 square brackets, with commas between the items (in square brackets, with commas between the items).
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. · คลิก Run เพื่อดูผลลัพธ์ที่นี่