Ask coding questions

← Back to all posts
What do I do wrong here?
CapnDom

I have written this little bit of code, I am entirely new and just tried a few things out. I played around with input, and then I moved on to else if statements with that input and everything worked fine until I tried to write a loop and now line 9 of my code has "unknown intend" although it worked before.

What did I do wrong?

Voters
CapnDom
Comments
hotnewtop
SixBeeps

That says indent, not intend. It means you indented your code wrong (indentation is the spaces/tabs you put in front of a line of code). In this case, the if statement on line 9 has one too many spaces. Remove one and it'll run.

CapnDom

@SixBeeps Okay, thank you. The indenting was the problem. I wasn't aware that would be important in python. But hey, that's why I am playing around with it, am I not?

I had to fix the other indentions aswell, and boy was that a try n error for me. But I do understand it a little better now.

Thanks again.

SixBeeps

@CapnDom Yeah, that's one of the biggest complaints about Python. Go to any other language, and you'll find that indentation isn't as big of a deal. But, I digress. Glad I could help you!

LordPython404


0_0 Did you just ki11 me?0_0

CapnDom

@LordPython404 Oh man, thats tough luck. Technically you're not dead, it's bottomless. Sooo..... I hope that consoles you a little haha

LordPython404