+ 7

Why does this program not working (python)

I made this as my first program in python but it does not working please help me https://code.sololearn.com/c1XXe81yo036/?ref=app

19th Dec 2018, 7:08 PM
Shobhit
Shobhit - avatar
3 Respuestas
+ 9
because when you define n using input(), its default type is a string. to solve that, just wrap the input in the int() function like this: n = int(input())
19th Dec 2018, 7:14 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 6
no problem
19th Dec 2018, 7:17 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 5
Thnks
19th Dec 2018, 7:14 PM
Shobhit
Shobhit - avatar