Python - Basic Syntax

---Restore content begins---

List:

Lists are equivalent to arrays in other languages. An example of its definition is as follows:

name = ['honda', 'yamaha', 'suzuki']

The index of the list starts from 0. You can also use -1 for the last item and -2 for the penultimate item, for example:

print(name[0])    # 'honda'
print(name[-1])   # 'suzuki'

 

---End of recovery content---

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325177802&siteId=291194637