fork download
  1. # (1) 创建列表并输出
  2. scores = [85, 90, 78, 92, 88]
  3. print(scores)
  4. # 输出: [85, 90, 78, 92, 88]
  5.  
  6. # (2) 输出第3个元素(索引从0开始)
  7. print(scores[2])
  8. # 输出: 78
  9.  
  10. # (3) 获取列表长度
  11. print(len(scores))
  12. # 输出: 5
Success #stdin #stdout 0.09s 14092KB
stdin
Standard input is empty
stdout
[85, 90, 78, 92, 88]
78
5