Python Programs with Question Statements and
Outputs
1. To print personal information, like Name, Father’s Name, Class,
School Name
Program:
print("Name: Arsh")
print("Father's Name: Rajesh")
print("Class: 8")
print("School Name: ABC School")
Output:
Name: Arsh
Father's Name: Rajesh
Class: 8
School Name: ABC School
2. To print Hello World
Program:
print("Hello World")
Output:
Hello World
3. To find the square of the number 7
Program:
num = 7
print(num * num)
Output:
49
4. To find the sum of two numbers 15 and 20
Program:
print(15 + 20)
Output:
35
5. To convert the length given in kilometres into metres
Program:
km = 5
print(km * 1000)
Output:
5000
6. To print the table of 5 up to five terms
Program:
for i in range(1, 6):
print("5 x", i, "=", 5*i)
Output:
5x1=5
5 x 2 = 10
5 x 3 = 15
5 x 4 = 20
5 x 5 = 25
7. To calculate Simple Interest (SI), if the principle amount = 2000,
rate of interest = 4.5, and time = 10
Program:
p = 2000
r = 4.5
t = 10
si = (p * r * t) / 100
print(si)
Output:
900.0