{"id":162843,"student_id":2589,"content":"#1 - 印出0-10\nfor i in range(11):\n print(i)\n \n#2 - 印出0-100之間的偶數\nfor i in range(0, 101, 2):\n print(i)\n\n#3 - 印出100-50之間的偶數 \nfor i in range(100, 49, -2):\n print(i)\n\n#4 - 串列家總及平均\ntotal = 0\narr = [80, 75, 98, 69, 83, 92]\nfor i in arr:\n print(i)\n total = total + i\navg = total/len(arr)\nprint(avg)\n\n#4 - 串列家總及平均\ntotal = 0\narr = [80, 75, 98, 69, 83, 92]\nfor i in range(len(arr)):\n print(arr[i])\n total = total + arr[i]\navg = total/len(arr)\nprint(avg)\n\n#5-1 - 印長方形\nfor i in range(10):\n string = \"\"\n for j in range(10):\n string = string+\"*\"\n print(string)\n\n#5-2 - 印直角方形 \nfor i in range(10):\n string = \"\"\n for j in range(10-i):\n string = string + \" \"\n for j in range(i+1):\n string = string + \"*\"\n print(string)\n\n#5-3 - 印星星\nfor i in range(10):\n string = \"\"\n for j in range(i, 10):\n string = string + \" \"\n for j in range(i*2+1):\n string = string + \"*\"\n print(string)\n \n#5-3 - 印星星\nfor i in range(10):\n print(' '*(10-i)+'*'*i*2+'*')\n \n\n \n","created_at":"2020-07-06T01:19:32.314+08:00","updated_at":"2020-07-11T17:16:58.913+08:00","name":"迴圈練習_T ","language":"python","screenshot":{"url":"https://cdn9.koding.school/uploads/project/screenshot/162843/78c61e7f1ead7988a942b4dbd445e807.jpg"},"parent_id":160691,"plugin":"","description":null,"note":null,"status":"public","like_student_ids":[],"is_featured":false,"views":86,"hashid":"9ygsmez9","is_content_changed":false,"review_status":"unsubmitted","submitted_at":null,"reviewed_at":null,"advise":null,"is_deleted":false}
[{"id":2832565,"file_name":"cloud.png","project_id":162843,"asset_id":182921,"created_at":"2020-07-06T01:19:32.320+08:00","updated_at":"2020-07-06T01:19:32.320+08:00"},{"id":2832566,"file_name":"bg.jpg","project_id":162843,"asset_id":182922,"created_at":"2020-07-06T01:19:32.321+08:00","updated_at":"2020-07-06T01:19:32.321+08:00"},{"id":2832567,"file_name":"koding.png","project_id":162843,"asset_id":182923,"created_at":"2020-07-06T01:19:32.322+08:00","updated_at":"2020-07-06T01:19:32.322+08:00"},{"id":2832568,"file_name":"calm.mp3","project_id":162843,"asset_id":182924,"created_at":"2020-07-06T01:19:32.323+08:00","updated_at":"2020-07-06T01:19:32.323+08:00"}]
橘蘋學習平台
橘蘋學習平台
我的作品
檢視專案頁
匯出
複製
匯入
刪除
截圖
幫助
用手機掃描下方 QRCode 進行安裝
或您也可以
下載 APK
到這台電腦