So I am new to python. Have written code in java years ago. As part of a beginner friendly udemy course I wrote the following program:
print("Please Enter the first number: ")
num1 = input()
print("Please Enter the second number: ")
num2 = input()
def greaterOfTwo(num1, num2):
if num1 > num2:
return num1
else:
return num2
print("The greater number is:", greaterOfTwo(num1, num2))
The weird part is my program only works for certain cases. for e.g. if I enter num1 as 5 and num2 as 10 the program returns 5 as the greater number:
Please Enter the first number:
5
Please Enter the second number:
10
The greater number is: 5