I try to find the greater number of the two numbers inputting by the user, using function. Please help me identify the fault I made in the code which produces a wrong result:
def func1(n1,n2):
if (n1 > n2):
print(n1," is greater than ",n2)
else:
print(n2," is greater than ",n1)
print("Find which number is greater")
num1 = input("Enter the first number: ")
num2 = input("Enter the second number: ")
func1(num1, num2)
It shows a wrong result:
Find which number is greater
Enter the first number: 10
Enter the second number: 5
5 is greater than 10