0% found this document useful (0 votes)
5 views2 pages

Python Programs with Outputs Explained

The document contains a series of Python programs that demonstrate basic programming concepts. Each program is accompanied by its output, covering tasks such as printing personal information, calculating squares, summing numbers, converting units, and calculating simple interest. The examples are straightforward and suitable for beginners learning Python.

Uploaded by

arshkhandelwal26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Python Programs with Outputs Explained

The document contains a series of Python programs that demonstrate basic programming concepts. Each program is accompanied by its output, covering tasks such as printing personal information, calculating squares, summing numbers, converting units, and calculating simple interest. The examples are straightforward and suitable for beginners learning Python.

Uploaded by

arshkhandelwal26
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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

You might also like