Computer Science and Entrepreneurship Python Programming Control Structures Medium Q1. Which statement is optional in an if structure? if elif else All of the above
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q2. What will happen if a while loop condition is always true? Syntax error Infinite loop Program ends Loop runs once
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q3. Which keyword is used to exit from a function or loop? stop break exit return
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q4. What will be the output? for i in range(3): print(i) 1 2 2003 2000 1 2 0 1 2 3 Error
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q5. What is the correct syntax of a while loop? while x > 5 {} while (x > 5): while x > 5: while x > 5 then
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q6. Which loop executes at least once? for loop while loop do-while loop None of these
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q7. What does the continue statement do? Stops the program Exits loop Skips current iteration Repeats loop infinitely
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q8. What does the break statement do? Skips one iteration Ends the loop Restarts the loop Pauses execution
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q9. Which loop is used when the number of iterations is known? while for if else
Computer Science and Entrepreneurship Python Programming Control Structures Medium Q10. What will be the output? if 5 > 3: print('Yes') No output Yes Error FALSE