Date: _________________________
Name: ________________________________________________________
Subject: _____________ Class: ____________
Worksheet 2: Python
Q1. a. Write code to store the number 25 in a variable named age.
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
b. Identify the error in this code: print("Hello" + 5).
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
c. Explain the difference between an Integer and a String.
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
d. Write an if-else statement that prints "Pass" if a score is 50 or above, and "Fail" otherwise.
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
e. Create a program that takes two numbers as input and prints their product.
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….
……………………………………………………………………………………………………………….