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コード
削除
自動保存:
を復元しますか?