返回列表 發帖

for 迴圈 (四)

橫向遞增顯示1~99間所有奇數

  1. for i in range(1,100,2):
  2.     print(i,end=" ")
複製代碼

  1. for i in range(1,50,3):
  2.     print(i,end=" ")
複製代碼

TOP

本帖最後由 朱宥愷 於 2024-7-9 11:52 編輯
  1. for i in range(1,99,2):
  2.     print(i,end=' ')
複製代碼

TOP

本帖最後由 曾煒峻 於 2024-7-9 11:52 編輯
  1. for x in range(1,100,2):
  2.     print(x,end="  ")
複製代碼

TOP

for i in range(1,100,2):
    print(1,end=" " )
for i in range(99,0,-2):
    print(1,end=" " )

TOP

  1. for i in range(99,0,2):
  2.     print(i,end=" ")
複製代碼

TOP

  1. for i in range(1,100,2):
  2.     print(i,end=" ")
複製代碼

TOP

  1. for i in range(1,100,2):
  2.     print(i,end=" ")
複製代碼

TOP

  1. for j in range(1,101,2):
  2.     print(j,end=' ')
複製代碼

TOP

  1. for i in range(1,100,2):
  2.     print(i,end=" ")
複製代碼

TOP

  1. for i in range(1,100,2):
  2. print(i,end=" ")
複製代碼

TOP

  1. for i in range(1,100,2):
  2.     print(i,end=" ")
複製代碼

TOP

  1. for a in range (1,100,2):
  2.     print(a, end=" ")
複製代碼

TOP

for i in range(1,100,2):
    print(i,end=" ")

TOP

for i in range(1,100,2):
    print(i,end=" ")

TOP

回復 1# 鄭繼威


    for i in range(1,100,2):
     print(i,end=' ')

TOP

for i in range(1,100,2):
    print(i,end=" ")

TOP

回復 1# 鄭繼威


    for i in range(1,100,2):
    print(i,end=" ")

TOP

for i in range(1,100,2):
    print(i,end=" ")

TOP

for i in range(1,99+1,2):
    print(i,end = ' ')

TOP

返回列表