There are multitude of problems in your code, for start:
1. remove lines 1 and 2 - you don't need them
2. dedent lines 16 and 17, so that they are not part of the function
3. You need to convert num to
4. You need to pass num (after being converted to int) as argument when calling the function on line 17
Note, this will not resolve problems with the logic you implement (i.e. there are more problems in the code)
1. remove lines 1 and 2 - you don't need them
2. dedent lines 16 and 17, so that they are not part of the function
3. You need to convert num to
int
, because input will returns str
4. You need to pass num (after being converted to int) as argument when calling the function on line 17
Note, this will not resolve problems with the logic you implement (i.e. there are more problems in the code)
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs