Competitive Programming Questions of Python |
Python code to find out the maximum of three numbers.
If you are looking for Python Tutorial then it's here.
def max(n1,n2,n3):
def max2(n1,n2):
if n1>n2:
return n1
else:
return n2
return max2(max2(n1,n2),n3)
def main():
n1 = int(input('Enter first Number: '))
n2 = int(input('Enter second Number: '))
n3 = int(input('Enter third Number: '))
maximum = max(n1,n2,n3)
print('Maximum number is ',maximum)
main()
When you run the above code. The output will be:
Enter first Number: 65
3Enter second Number: 2
Enter third Number: 98
Maximum number is 98
Comments
Post a Comment