Advertisements
Advertisements
प्रश्न
Using if..else..Elif statement writes a suitable program to display the largest of 3 numbers.
Advertisements
उत्तर
num 1 = int (input(“Enter first number : “))
num 2 = int (input(“Enter second number : “))
num 3 = int (input(“Enter third number : “))
if (num 1 > num 2) and (num 1 > num 3):
largest = num 1
elif (num 2 > num 1) and (num 2 > num 3):
largest = num 2
else:
largest = num3
print (“The largest number is”, largest)
Output:
Enter first number: 7
Enter second number: 5
Enter third number: 4
The largest number is 7
APPEARS IN
संबंधित प्रश्न
How many important control structures are there in Python?
Elif can be considered to be the abbreviation of ______.
Which is the most comfortable loop?
What is the output of the following snippet?
i=1
while True:
if i%3 ==0:
break
print(i,end='')
i +=1
Which amongst this is not a jump statement?
List the control structures in Python.
Write a note on the range () in the loop?
Write a program to display.
A
A B
A B C
A B C D
A B C D E
Write a program to display all 3 digit odd numbers.
Write a program to display a multiplication table for a given number.
