1) Why do we need conditional statements in coding? a) To enable computer to count a mathematic question b) To enable computer to make decision c) To enable debugging process d) To assign a solution to a problem 2) Choose the wrong statement. a) elif is added before if statement b) elif = else-if c) elif is compulsory in if-else statement d) elif is added before else statement 3) How do you write "if statement" ? a) if [color = "blue]; b) if(color == blue): c) if (color = "blue"); d) if (color == "blue"): 4) If all the conditions are not matched, a) if code block will be executed b) elif code block will be executed c) else code block will be executed d) no action will be executed 5) Find the correct match. a) == less than b) != not equal to c) >= greater than d) < equal to 6) To assign x to 20, we write... a) x >= 20 b) x == 20 c) x = 20 d) x != 20 7) For the code if (age >= 18): a) It will execute for aged 18 or above b) It will execute for aged 18 and below c) It will execute for age 18 only d) It will execute for all except aged 18 8) Which classification is wrong? a) else -> conditional operator b) elif -> conditional operator c) == -> comparison operator d) not -> comparison operator 9) Choose the correct explaination a) and -> both true = true b) not -> wrong remains wrong c) or -> one correct, one wrong = wrong d) and -> both wrong = correct 10) if (weather == "sunny" and temp == 28): a) If temperature is 28 degree Celcius , the weather is rainy b) The weather is hot if temperature is 28 degree Celcius c) Weather is sunny if temperature is 28 degree Celcius d) Either temperature is 28 degree Celcius or weather is sunny 11) randomNumber = random.randint(0,9) a) 10 is accepted result b) The value is called randomNumber c) Generate a random number between 0-9 d) The result is not stored to a variable 12) Which situation uses an "if-else" statement a) traffic light colour b) win/lose situation c) weather condition d) type of transport used
0%
Coding Quiz (8) - Conditional Statements
共用
共用
共用
由
Guanjie0807
10-12 years old
編輯內容
列印
嵌入
更多
作業
排行榜
顯示更多
顯示更少
此排行榜當前是私有的。單擊
共用
使其公開。
資源擁有者已禁用此排行榜。
此排行榜被禁用,因為您的選項與資源擁有者不同。
還原選項
問答遊戲
是一個開放式範本。它不會為排行榜生成分數。
需要登錄
視覺風格
字體
需要訂閱
選項
切換範本
顯示所有
播放活動時將顯示更多格式。
打開結果
複製連結
QR 代碼
刪除
恢復自動保存:
?