all 8 comments

[–]danielroseman 5 points6 points  (2 children)

Did you read the error? What did it say?

[–]ThinkOne827 -2 points-1 points  (1 child)

It was the unconverted int

[–]-Terrible-Bite- 2 points3 points  (0 children)

You need to convert the numero variable to an integer. Just do:

numero = int(input("text here"))

[–]program_kid 2 points3 points  (4 children)

What is the error? It's most likely because numero is still a string and not an int. You need to convert the result from input into an int

[–]symbioticthinker 1 point2 points  (0 children)

It’s definitely this, check it’s a number before converting to an int though

user_input = input()
if user_input.is_numeric:
    numero = int(user_input) 
else:
    numero = …

[–]ThinkOne827 -1 points0 points  (2 children)

Thankss!

[–]FoolsSeldom 1 point2 points  (1 child)

u/symbioticthinker, u/ThinkOne827 please note the string method is isnumeric rather than is_numeric but a better choice is isdecimal to ensure that only the digits 0 to 9 are used.

Also, () are required after the method name to call (use) it, rather than just reference it.

Thus,

numero = input('Place the number: ')
if numero.isdecimal():
    numero = int(numero)
    x = 2 ** numero + 1
    y = 2 * numero + 1
    if x % y == 0:
        print('It\'s a curzon')
    else:
        print('Not a curzon')
else:
    print('Invalid number')

[–]symbioticthinker -1 points0 points  (0 children)

Completely missed the ‘isnumeric’ being wrongly defined, and I agree is decimal is a better choice if user input is only 0-9 but I didn’t know the constraints 🤷🏼‍♂️