用 while 循環作個小遊戲

import random #可輸入次數 flag = 0 #生成一個1到10之間的隨機整數 res = random.randint(1,10) #判讀三次輸入機會 while(flag<3): temp = input('來,猜猜我內心想的數字是什麼?\r\n') #格式化輸入的字符串數字爲整型 temp = int(temp) #若是相等 if te
相關文章
相關標籤/搜索