Display the larger / smaller number in Python.

Input two numbers and display the larger / smaller number in Python. Today we are showing the code in python. This python project is useful for beginners, CBSE School Class 11 students Computer Science practical file and NIELIT O Level Programming and Problem Solving through Python (Module M3-R5).

If/else case in Python

In if case first the condition in the same line of if is evaluated if it is true then it is executed and else the commands after else is executed. So, This is evaluation method , plus executing method.

Objective : Input two numbers and display the larger / smaller number in Python.

Screenshot of the source code written it is very important to read every step

Program code Input two numbers and display the larger / smaller number in Python.

Python Program to find Largest of two Numbers using if-else statements

a = int(input(“Enter the first number: “)) #input first number
b = int(input(“Enter the second number: “)) #input second number
if(a >= b): #comparing
print(a, “is greater”)
else:
print(b, “is greater”)

Output of the program

We enter the first number : 56 and the second number :28 an then comparing it tells 56 is greater.

Testing is done .

Run the python program and enter the required data.

Source code of Program -> click here

Thanks for reading and learning about this program.

for more python programs -> click here

Hello World Program in Python

Input a welcome message and display it in Python

Display the larger / smaller number in Python.

Greatest of Three Numbers in Python using Nested if

Patterns using nested loop in Python

Program to Print Pattern in Python

Program to input the value of x and n and sum of series in Python

Python Program for Armstrong, Prefect Number, Palindrome

Program of Prime number by recursion in python

Prime Number Program in Python

Write a Program to Print Fibonacci Series in Python

LCM and GCD program in Python

Python program to count number of vowels in a string

Whether a String is Palindrome or not in Python

Bubble Sort Program in Python

Linear search in python using list

Program to read a text file in python

Python program to read a file line by line

Program to Count Vowels and Consonants in Python

Stack Program in Python

Queue Program in Python

Python Leap Year Program for Beginners

Python Program to Print Series and Addition

Binary Search Program in Python

Program to find sum of digits in python

Sum of numbers divisible by 3 and 5 in python

error: Content is protected !!