返回列表 發帖
本帖最後由 林佩萱 於 2025-1-24 11:22 編輯
  1. list1=["忠","孝","仁","愛","信","義","和","平"]
  2. list2=[28,27,27,26,28,29,30,27]
  3. for i in range(8):
  4.     print("五年{}班有{}人".format(list1[i],list2[i]))
複製代碼

TOP

list1=["忠","孝","仁","愛","信","義","和","平"]
list2=[28,27,27,26,28,29,30,27]
for i in range(8):
    print("五年{}班有{}人".format(list1[i],list2[i]))

TOP

a = ['忠','孝','仁','愛','義','和','平']
b = [28,27,27,26,26,28,29,30,27]

for i in range(len(a)):
    print('五年',a,'班有',b,'人',sep='')

TOP

返回列表