You are on page 1of 2

Grade 10 – Computer– Revision Worksheet

Programming the computer

Name:.hadi shatat..............................
Class:.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")
a.print 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.
x = 25 + 5
…………………………………………………………………
print(x)
…………………………………………………………………
…………………………………………………………………
…………………………………………………………………

Q3. Write a Python program to find the Average of three numbers.


num1 = 3
…………………………………………………………………
num2 = 5
…………………………………………………………………
num3 = 10
avg = (num1 + num2 + num3)/3
…………………………………………………………………
print('The average of numbers = %0.2f' %avg)
…………………………………………………………………

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:
…………………………………………………………………
print("{0} is Odd".format(num))
…………………………………………………………………
…………………………………………………………………

You might also like