ข้ามไปยังเนื้อหาหลัก

Python Lists Tutorial

A list is a compound data type where you can group values together. A Python list is a convenient way of storing information altogether rather than individually.
· 4 นาที อ่าน

สำรวจด้วย AI

As opposed to data types such as int, bool, float, str, a list is a compound data type where you can group values together. In Python, it would be inconvenient to create a new python variable for each data point you collected. What you can do instead is, store all this information in a Python list. You can build such a list with square brackets.

[a, b, c]