返回列表 發帖

for 迴圈 (一)

直向顯示第1名~第5名
  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼
附件: 您需要登錄才可以下載或查看附件。沒有帳號?註冊

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. list1 = [1,2,3,4,5]

  2. for i in list1:
  3.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. # -*- coding: utf-8 -*-
  2. """
  3. Spyder Editor

  4. This is a temporary script file.
  5. """
  6. for i in range(1,6):
  7.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名"
複製代碼

TOP

  1. a=[1,2,3,4,5]
  2. for b in a:
  3.     print("第{}名".format(b))
  4. for c in range(1,6):
  5.     print("第{}名".format(c))
複製代碼

TOP

  1. for x in range(1,21):
  2.     print("第",x,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for a in range(1,6):
  2.     print("第",a,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for i in range(1,6):
  2.     print("第",i,"名")
複製代碼

TOP

  1. for a in range(1,6):
  2.     print("第",a,"名")
複製代碼
陳頡鴻

TOP

返回列表