I want to check if whether input is numeric, If it is, Compare the number to another.
I tried to resolve one issue by removing int() conversion. But that would render x > 0 useless.
Tried searching online, But there's no simple resolve.
print("This program prints the sum of a range of numbers from x to y") print("For example, if x is 10 and y is 50, the program will print the sum of numbers") print("from 10 to 50") x = int(input("Please enter the value of x: ")) y = int(input("Please enter the value of y: ")) if x.isnumeric() and y.isnumeric(): if x > 0 and y > 0: print("Passed") else: print("failed") else: print("One or more of your inputs are not numeric!")
Got 'int' object has no attribute 'isnumeric' as error or '>' not supported between instances of 'str' and 'int'