Olympiad (Class 10) Booleans and Decisions — practice questions
22 free MCQs with worked solutions. Tap any question for the answer + explanation, or practice them all in the app.
Practice Olympiad (Class 10) Booleans and Decisions in the app →A quiz app stores whether a player passed. The data type it should use is:A login screen checks whether user equals admin. The comparison returns:A coder writes is_zero = num = 0 and every value gets wiped. His mistake was using:A program must test, not change, a variable. The correct operator is:A game checks if a score is even. A number is even when it divides exactly by:An expression that evaluates to either true or false is called a:In a Python if statement, the body runs only when the condition is:A learner writes an if statement with nothing in its body. Python will produce:PEP 8 recommends indenting each level of a Python body by how many spaces?Instead of writing if is_raining == True, a tidy programmer writes:When an if else statement runs, the number of branches actually taken is:In Python the else keyword must sit at the same indentation level as the:Python provides how many logical operators?A club entry rule needs both age and ticket to be valid. The operator to use is:A concert lets in anyone in band or choir. The operator to use is:A program should act when a computer is switched off. The operator to use is:In Python the expression 1 + 2 * 3 evaluates to:In Python the expression (1 + 2) * 3 evaluates to:The rule deciding order when two operators share a precedence level is:Most Python operators are evaluated in which direction?A curve program uses two separate if statements and both run by mistake. The fix is to use:An elif statement is only legal when it directly follows an if or another: