Python program to find largest of 2 numbers
In this example, we will learn how to find the largest number in two given numbers.
for this we use decision-making statements if-else.
num1 = int(input(‘Enter any number: ‘))
num2 = int(input(‘Enter any other number: ‘))
if( num1 > num2):
print(‘ {0} is greater than {1}’.format(num1,num2))
else:
print(‘ {0} is greater than {1}’.format(num2,num1))
Output
Enter any number: 25
Enter any other number: 15
25 is greater than 15
Python Program to add two numbers
Python program to find Area of Square
Python program to find Area of Triangle
Python program to swap two variables
Python program to convert Celsius to Fahrenheit
Python program to generate Random Number
Python program to convert Miles to Kolometers
Python program to find Largest of 2 numbers
Python program to check if number is Odd or Even
Python program to check if number is Positive Negative or Zero
Python program to check Leap Year
Types of Loop in Python
Python program to check Prime Number
Python program to Calculate Sum of N Natural Numbers
Python program to find sum of All Even Number between 1 to 10
Python program to find sum of All Odd Number between 1 to 10
Python program to check Armstrong Number