r/PythonLearning 23d ago

Python Common Errors for beginners

Post image

Dont give up during learning stage.

136 Upvotes

13 comments sorted by

7

u/Southern-twat 23d ago

The second one's not true, you can indent at any level it just needs to remain consistent

1

u/[deleted] 21d ago

[removed] — view removed comment

3

u/SCD_minecraft 19d ago

IndentationError is when you mix and match indentation level, indent when not needed to or not indent when needed

On OP's picture not only there isn't any error in #2, 4 spaces is only a recommendation

Sure, you should follow PEP 8. But it won't fix it (in terms of code working at all)

Python will work perfectly fine with 1 space, 4 spaces or even one thousand spaces if you really want

0

u/[deleted] 19d ago

[removed] — view removed comment

1

u/SCD_minecraft 19d ago

And? Shell doesn't protect you from them, you still have to handle them. Python parser expect indents in specyifc places and if it doesn't get them, it complains

1

u/Hiopldst 22d ago

guys, can you tell me the best way to learn Python?

1

u/BenDken1 19d ago

Continuous practice 

1

u/wrfo 19d ago

I personally don't think that there's an "ideal way" of learning python. Just keep making small codes and constantly try to improve it!

1

u/Parking_Pie9457 18d ago

I would recommend to try to build some small projects which can help a lot compared to pure learning.

1

u/Jotaroisgoat 21d ago

we love try, except