0% found this document useful (0 votes)
10 views

Python Lab Question 4

Uploaded by

hhabibulla344
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Python Lab Question 4

Uploaded by

hhabibulla344
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Aim: Write a Python program to find the largest of three numbers.

Algorithm:

1. Take three numbers as input.

2. Compare the first number with the second and third numbers.

3. Compare the second number with the first and third numbers.

4. Compare the third number with the first and second numbers.

5. Print the largest number.

Program:

a = 10

b = 25

c = 15

if a >= b and a >= c:

largest = a

elif b >= a and b >= c:

largest = b

else:

largest = c

print('Largest number:', largest)

Output:

Largest number: 25

You might also like