Page Contents
Interview Content
- C Programming Coding Questions
- C Pattern Programming Questions
- C Programming Interview Questions
- Java Programming Coding Questions
- Java Pattern Programming Questions
- Java Programming Interview Questions
- Python Programming Coding Questions
- Python Pattern Programming Questions
- Python Programming Interview Questions
- SQL Interview Questions
Program to Find the max of 3 numbers in python
Ans:
In this tutorial you will learn how to write a program in Python to find largest of three numbers.
How our program will behave?
Suppose if someone give 3 numbers as input 12, 15 and 10 then our program should return 15 as a output because 15 is a greatest among three.
Python program to find greatest of three numbers
n1 = int(input("please give first number n1: "))
n2 = int(input("please give second number n2: "))
n3 = int(input("please give third number n3: "))
if n1>=n2 and n1>=n3:
print(" n1 is greatest");
if n2>=n1 and n2>=n3:
print(" n2 is greatest");
if n3>=n1 and n3>=n2:
print("n3 is greatest");
Output:
Also prepare these Python Programs:
- Write a program to reverse an integer in Python.
- Write a program in Python to check whether an integer is Armstrong number or not.
- Python Program to check a given number is Prime number or not.
- Write a program in Python to print the Fibonacci series using iterative method.
- Write a program in Python to print the Fibonacci series using recursive method.
Latest Uploads on Website
- AVL Tree with explanation
- Radix sort algorithm explanation with example
- Quick Sort Algorithm with explanation
- Bubble sorting algorithm with Bubble sort program in C
- Insertion sort algorithm and program in C
- Selection Sort Algorithm and Program in C
- Linear probing technique explanation with example
- Collision in Hashing and Collision resolution technique
- Hashing in data structure with its types
- Binary search tree operations with Program
- Binary search tree in data structure
- Binary search algorithm in data structure with explanation
- linear search in data structure with Algo and Program