1. The 'SELECTION' statements that are available in programming are IF -THEN - ELSE and SWITCH-CASE.
2. Why is selection or an IF ELSE statement used in a program?
3. Run the following code, if possible, or trace the logic, to see what it does. How are the equal signs on line 4 and 5 different?
4. What is ELIF likely to stand for or mean?
5. Analyse the code carefully. If the user enters '3333' , what will happen?
6. Run the program and analyse it. If the user enters 2000 it should present the expensive cars, but it doesn’t. How can we fix this?
7. Analyse the two code blocks below. Which of the following statements is likely to be true?
8. There are two errors in the following code - can you spot what they are?
9. What are conditions? They check to see whether something is true or false. 2 < 5 will evaluate to:
10. The expression 3>7 will evaluate to:
11. If, elif and else are ___________ in Python
12. Typical conditions are shown in the list below. What is the !=
13. Analyse the code below. If the user entered '22' what would the output be?
14. An if ... elif ... elif ... sequence is a substitute for the switch or case statements found in other languages
15. Generally speaking the 'else' part of an if elif seqeuence (with else at the end) will run if ….
16. On what line are the errors?
17. On what line is the error that is stopping this code from running?
18. There are two errors in this code - can you spot them?
19. You want to accept any number over 7, including 7 as a secret code. What should line 3 be changed to?
20. How could a game like minecraft use selection? (if statements)