Python Worksheet: Input, Output & Data Types (40 mins)
YOU MUST SCREENSHOT YOUR CODE UNDER EACH TASK!
Lesson Objective
To:
Use input() and print()
Understand str, int, and float
Perform calculations using user input
Key Knowledge (Read First)
String (str)
Stores text
Must use quotation marks
word = "Hello"
Integer (int)
Stores whole numbers
number = 10
Float (float)
Stores decimal numbers
decimal = 2.5
⚠️Important Rule:
input() always returns a string, so convert when needed:
number = int(input("Enter a number: "))
decimal = float(input("Enter a decimal: "))
Starter (5 mins)
Q1. Identify the data type:
Data
Value
Type
"Python _________
" _
_________
50
_
_________
7.25
_
Q2. What is wrong with this code?
num = input("Enter number: ")
print(num + 5)
Main Tasks (25 mins)
Task 1: Input & Output (5 mins)
Q3. Write a program that:
Asks for text
Prints: "You entered ___"
_________________________________________
_________________________________________
Task 2: Integers (10 mins)
Q4. Complete the program:
num1 = ______(input("Enter a number: "))
num2 = ______(input("Enter another number: "))
total = num1 + num2
print(total)
Q5. Write a program that:
Asks for two whole numbers
Subtracts the second from the first
Prints the result
_________________________________________
_________________________________________
_________________________________________
Task 3: Floats (10 mins)
Q6. Write a program that:
Asks for a decimal number
Multiplies it by 2
Prints the result
_________________________________________
_________________________________________
_________________________________________
Q7. Write a program that:
Asks for a price (float)
Adds 20%
Prints the final price
_________________________________________
_________________________________________
_________________________________________
_________________________________________
Extension Tasks (10–15 mins) ⭐ Higher Ability
Complete as many as possible.
Extension 1: Mixed Data Types
Write a program that:
Asks for text (str)
Asks for a number (int)
Prints both clearly
Extension 2: Total Cost Calculator
Write a program that:
Asks for item price (float)
Asks for quantity (int)
Calculates total cost
Prints the result
Extension 3: Average Calculator
Write a program that:
Asks for 3 numbers (int)
Calculates the average
Prints the result
Extension 4: Temperature Converter
Write a program that:
Asks for temperature in Celsius (float)
Converts to Fahrenheit
Formula:
F = (C × 9/5) + 32
Extension 5: Challenge ⭐⭐
Write a program that:
Asks for a number
Prints:
o Number × 2
o Number × 3
o Number × 4
Extension 6: Challenge ⭐⭐⭐ (Top Students)
Write a program that:
Asks for a price (float)
Asks for discount percentage (int)
Calculates the new price after discount
Prints the final value
Plenary (5 mins)
Q8. What will this output?
num = int(input("Enter number: "))
print(num * 3)