1. _________ is when you find an issue in the program that you have written and repair it.
2. Analyse the code below. Which statement is most accurate?
3. Why, if at all, will the following program fail to run?
4. Can you spot the error?
5. Analyse the following code. If the user enters the number 4, the output is 54 instead of 5+4 = 9. Why?
6. How would you describe what is written on lines 2 and 5?
def add():
#z is a variable that holds the value 5
z=5
secret_number=input("Enter number:")
#next, we have the output command
print(str(z)+secret_number)
add()
7. Name the data type that would be used for the following:
8. Name the data type that would be used for the variable pocketmoney that stores the value: ?3.50
9. Steve is creating a cinema booking system. A seat can either be TRUE or FALSE. What data type should he use for seat?
10. There may be times when you want to specify a type on to a variable. This can be done with ______.
11. Analyse the following code. If the input is 2, what is the output?
12. In the above code (previous question), on what line, if any, can you spot an example of casting?
13. The comparison (double equal sign) operator ( == ) is used to assign a value to a variable or a constant.
14. Why will the following code fail to run?
15. Analyse the following use of the / and // operators. Which statement is correct?
16. Analyse the following code which contains an if statement and a comparison operator - the greater than sign. What is the output?
17. Consider the code in the question above. If you change the value contained in the variable b to 555, what will the output be?
18. In the following program, the secret agent enters the numbers 777 which should let him in, but instead there is an error. Why?
19. There is something quite small missing from this code that will prevent it from working. Can you spot the error?
20. The three main programming constructs are 1) Sequence, 2)Selection and 3)Itereation. Selection refers to: