{"id":1001349,"student_id":1443,"content":"from game import *\nimport random\n\nanswer = random.randint(1, 100) # 產生答案\nprint(answer) # 印在主控台測試用\n\ntext = '點擊畫面猜 1 - 100 數字' # 顯示文字\ncount = 0 # 猜的次數\n\ndef guess():\n global text, count\n \n try:\n # TODO: write code...\n g = int(input())\n if g \u003e answer: text = '結果:猜太大了'\n if g \u003c answer: text = '結果:猜太小了'\n if g == answer: text = '結果:猜對了'\n count += 1\n except :\n text = '請輸入數字!!'\n \ndef loop():\n draw_text(text, 100, 100, 'black', 50)\n draw_text('猜的次數: ' + str(count), 100, 170, 'black', 30)\n\non('click', guess) # 點擊畫面執行 guess 函式\nforever(loop) # 不斷執行遊戲迴圈","created_at":"2025-05-02T14:47:06.816+08:00","updated_at":"2025-05-02T14:51:26.035+08:00","name":"延伸挑戰_例外處理 副本","language":"python","screenshot":{"url":"https://cdn8.koding.school/uploads/project/screenshot/1001349/81cb7eec0a6b070d31f27d17cc32e6b4.jpg"},"parent_id":889620,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":43,"hashid":"5j3svj3dr","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[]
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
繁中
简中
English
日本語
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦