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

દ્વારા

લીડરબોર્ડ

દૃશ્યમાન શૈલી

વિકલ્પો

ટેમ્પલેટ બદલો

આપોઆપ સંગ્રહ થયેલ છે: ?