Python program to find largest of three numbers

0
46
num1=int(input("Please enter first number: "))
num2=int(input("Please enter second number: "))
num3=int(input("Please enter third number: "))
if((num1>num2)and(num2>num3)):  # use of logical and, which gives true only when both of its operands are true 
    print("",num1," is largest");
else: # when num1 is not largest 
  if((num2>num1)and(num2>num3)): # checks for num2 is larger than num1 and num3 using logical operator
    print("",num2," is largest");
  else: # when both above conditions are false then num3 is largest
    print("",num3," is largest");

   Output:
          Please enter first number: 10
          Please enter second number: 15
          Please enter third number: 20
           20  is largest

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

Python program to find largest of three numbers Program to find largest of three numbers in python write a program to find largest of three numbers in python Python program to check largest of three numbers a program to find largest of three numbers in python a program to find largest of three numbers program to find maximum between three numbers program to find maximum between three numbers in python write a program to find maximum between three numbers largest of three numbers in python largest of three numbers largest of three numbers program largest of three numbers in visual basic finding largest of three numbers using if-else..if finding largest of three numbers using if else if finding largest of three numbers using if else if in python python program finding largest of three numbers using if else if

LEAVE A REPLY

Please enter your comment!
Please enter your name here