PRACTICAL EXAMINATION-REVISION WORKSHEET
SUBJECT: COMPUTING
CLASS: 7
Note: Any one question will be given in the practical examination.
Question 1:
Practical Task: Summing the Number of Visits
Question:
Write a Python program following these instructions:
1. Initialize a variable total to 0. ([2 Marks])
2. Ask the user to input the number of visits.
o Convert the input into an integer. ([3 Marks])
3. Use a while loop to continue asking for the number of visits as long as the
input is not 99. ([4 Marks])
4. Inside the loop:
o Ask again for the number of visits.
o Convert the input to an integer.
o Add the input value to the total. ([6 Marks])
5. After the loop ends, display the value of total using print(). ([3 Marks])
6. Ensure the program runs without any syntax errors. ([2 Marks]
IPS/COMPUTING PRACTICAL REVISION SHEET/CLASS 7 Page 1 of 4
Detailed Mark Scheme:
Task Marks
Task Description Sub-Task Marks
No. Scored
1 Initialize total = 0 Correct initialization 2
2 Ask user input Prompt user input 1
Correct data type
Convert input to integer 2
conversion
Correct loop condition
3 while loop setup 4
(visits != 99)
4 Inside loop Ask input inside loop 2
Convert inside loop input Correctly handle input
2
to integer again
Add current input to total Correct addition logic 2
5 After loop ends Correctly print total 3
6 Syntax correctness Program runs error-free 2
Total 20
IPS/COMPUTING PRACTICAL REVISION SHEET/CLASS 7 Page 2 of 4
Answer:
total = 0
visits = input ("Enter the number of visits (Enter 99 to stop): ")
visits = int(visits)
while visits != 99:
total = total + visits
visits = input ("Enter the number of visits (Enter 99 to stop): ")
visits = int(visits)
print ("The total number of visits is:", total)
Question 2:
Write a Python program based on the following instructions:
1. Ask the user to enter the first number and store it in a variable.
2. Convert the input into an integer.
3. Ask the user to enter the second number and store it in another variable.
4. Convert the second input into an integer.
5. Divide the first number by the second number and store the result.
6. Print the result of the division.
Note: Make sure your code handles correct data types and runs without syntax
errors.
Marking Scheme:
Task Marks
Task Description Sub-Task Marks
No. Scored
1 Input first number input() for first number 2
Convert first input to
2 int() conversion 2
integer
3 Input second number input() for second number 2
IPS/COMPUTING PRACTICAL REVISION SHEET/CLASS 7 Page 3 of 4
Task Marks
Task Description Sub-Task Marks
No. Scored
Convert second input to
4 int() conversion 2
integer
5 Perform division Use / operator correctly 5
6 Display result print() statement 2
Code runs without syntax
7 Syntax correctness 3
errors
Code formatting and Clear variable names and
8 2
clarity structure
Answer:
number1=input("Enter a number")
number1=int(number1)
number2=input("Enter a number")
number2=int(number2)
result=number1/number2
print(result)
IPS/COMPUTING PRACTICAL REVISION SHEET/CLASS 7 Page 4 of 4