Activity solutions
Task 1 .
Find the sum of two numbers.
c
Subtract the second number from the first number.
a = int(input())
b = int(input())
result = a – b
Multiply two numbers.
a = int(input())
b = int(input())
result = a * b
Double a number.
a = int(input())
result = a * 2
Add three numbers.
a = int(input())
b = int(input())
c = int(input())
result = a + b + c
Find the sum of two decimal numbers.
Page 1
Activity solutions
a = float(input())
b = float(input())
result = a + b
Subtract the second number from the first number (decimals allowed).
a = float(input())
b = float(input())
result = a – b
Multiply two decimal numbers.
a = float(input())
b = float(input())
result = a * b
Task 2 .
Calculate the number of hours in a given number of days.
Ask for two numbers and add them together.
Convert minutes into seconds.
Page 2
Activity solutions
Find the square of a number.
Calculate the area of a rectangle.
Page 3