一個階梯程式,每迴圈一次就增加一個* y="*" for i in range(0,10): #0~9階 print(y," ",i+1) #顯示* 及數字 y=y+"*" #增加一個* ,放進變數y
確定! 回上一頁