JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
隨堂測驗:運算式
* Indicates required question
Email
*
Record my email address with my response
Q1. 下列敘述何者錯誤?
*
15 points
如果任一運算元是浮點數,則結果將轉換為浮點數。
「//=」是相除得到整除商數後再賦值給原變數。
「+=」相加後再賦值給原變數。
「/」、「%」與「//」三個運算子與除法有關,左邊運算元不可為零,右邊可以為零。
Q2. 下列敘述何者錯誤?
*
15 points
print( not 1 < 5 ) 結果是 False。
「or」是至少有一個為 True,則為 True
print( 5 != 5 ) 結果是 True。
「and」是兩者均為 True,則為 True。
Q3. 下列何者正確?(複選)
*
15 points
print( (1 > 6 or 3 < 9) and 7 != 4 ) 結果是 True。
print(1 is int) 結果是 True。
print(not 8%3 != 2) 結果是 True。
print('cp' not in 'MagicPython') 結果是 False。
Required
Q4. 下列程式的值為何?
*
x, y = 12, 10
print(x | y)
15 points
15
14
13
12
Q5. 林小宇設計了一個開寶箱的遊戲,並以二進位依序表示七色彩虹的顏色。
紅 |
橙 |
黃 |
綠 |
藍 |
靛 |
紫
------------------------------------
1 1 1 1 1 1 1
當同學執行程式時,可以隨機得到 1~253 的數字,最後列出得到哪些顏色?
import random
num = random.randint(1,253)
color = ""
請完善此區程式碼
print(color)
*
40 points
Your answer
Submit
Clear form
Never submit passwords through Google Forms.
Forms
This content is neither created nor endorsed by Google.
Report Abuse
Terms of Service
Privacy Policy
Help and feedback
Contact form owner
Help Forms improve
Report