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 代码
删除
恢复自动保存:
?