Advertisements
Advertisements
प्रश्न
Using if..else..Elif statement writes a suitable program to display the largest of 3 numbers.
उत्तर
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?
T=1
while T:
print(True)
break
Which punctuation should be used in the blank?
if<condition>_
statement-block 1
else:
statement-block 2
Write a program to display.
A
A B
A B C
A B C D
A B C D E
Write a note on if..else structure.
Write a detail note on for loop?
Write a program to display all 3 digit odd numbers.
Write a program to display a multiplication table for a given number.