Navbar menu
(Move to ...)
Home
Python
HTML
JavaScript
Quiz
AS400 / IBM iSeries
Contact Us
▼
Python program to find the greater of 2 numbers
Write a function in python to find the greater of 2 numbers.
Code Snippet:
def greater(a,b): if a > b: print(a,"is greater than ",b) else: print(b,"is greater than ",a) print("To find greater of 2 number") num1=int(input("Enter 1st number:")) num2=int(input("Enter 2nd number:")) greater(num1,num2)
Copy
Greater of 2 numbers
Output:
Output - Greater of 2 numbers
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment