Grade 10 – Computer– Revision Worksheet
Programming the computer
Name:………………………….
Rashed Maan Idrees Class:……………………
Grade/10
Q1. Choose the correct answer.
1. Which operator has higher precedence in the following list
a. - Subtraction b. + Addition a. ( ) Parentheses
2. What is a correct syntax to output "Hello World" in Python?
a. print ("Hello World") b. p ("Hello World") c. echo "Hello World
3. Which operator is used to multiply numbers?
a. % b. * c. #
4. What is the missing part of the code below to output "Hello World".
("Hello World")
[Link] b. add c. sum
5. What is the output of the following code?
x = 36 / 6+ 2
print(x)
a. 8.0 b. 36 c. 0
6. What is the output of the following code?
x = 25 / 5-(3+ 2)
print(x)
a. 0.0 b. 5 c. 25
7. What is the output of the following code?
a = 5
b = 3
if b > a:
print("b is greater than a")
else:
print("a is greater than b")
a. a is greater than b. b is greater than a c. 8
Q2. Write a Python program to find the addition of two
numbers.
num1 = 1.5
num2 = 6.3
sum = num1 + num2
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
Q3. Write a Python program to find the Average of three numbers.
num1 = 3
num2 = 5
num3 = 14
avg = (num1 + num2 + num3)/3
print('The average of numbers = %0.2f'
Q4. Write Python Program to Check if a Number is Odd or Even.
num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else: