Getting errors with the indentation of my code such as IndentationError and TabError. What may be causing those and how can I fix it? Any tool to help Indent code?
Hi,
Even though there are no strict rules on the amount of space/spaces to use per indent, you do need to be consistent with spacing, or else it may throw an IndentationError.
mixing spaces and tabs for indentation in Python 3 is prohibited. Mixing them would throw a TabError. 2 spaces per indent is most commonly used.
I am not sure about any tool though!
Read the blogs below to get your concepts cleared:
- https://www.scaler.com/topics/indentation-in-python/
- https://medium.com/@peey/what-is-the-inconsistent-use-of-tabs-and-spaces-in-indentation-error-and-why-is-it-caused-f3bbb8b2568b
Cheers!