返回列表 發帖

小星星 (一)

本帖最後由 tonyh 於 2022-7-14 16:12 編輯

  1. for i in range(____):
  2.     for j in range(____):
  3.         print(" ",end="")
  4.     for j in range(____):
  5.         print("*",end="")
  6.     print()
複製代碼
  1. for i in range(1,6):
  2.     for j in range(1,6-i):
  3.         print(" ",end="")
  4.     for j in range(1,i*2):
  5.         print("*",end="")
  6.     print()
複製代碼
  1. for i in range(5):
  2.     for j in range(4-i):
  3.         print(" ",end="")
  4.     for j in range(i*2+1):
  5.         print("*",end="")
  6.     print()
複製代碼

  1. for i in range(5):
  2.     for j in range(4-i):
  3.         print(" ",end="")
  4.     for j in range(2*i+1):
  5.         print("*",end="")
  6.     print()
複製代碼

TOP

  1. for i in range(5):
  2.     for j in range(4-i):
  3.         print(" ",end="")
  4.     for j in range(i*2+1):
  5.         print("*",end="")
  6.     print()
複製代碼

TOP

返回列表