+ 6
How to handle indentation in python.
As I started learning python recently...and from the background of programming languages like C++ and JAVA...so I am having some problem in it but the thing which is annoying me the most is it's indentation...like if I have made a code with loops and some if statements and then I want to handle exceptions with try and except...so i have to change all the indentation by adding tabs in each line...So I want to know is there a trick or a way to handle it. And one more help kindly tell me some free IDEs for python except of the python's official IDLE or shell
10 Antworten
+ 5
fra I downloaded it and it was free for 30days and after that it used to stop after 30mins
+ 5
fra okkay...Thanks..I will check it and tell you if my problem is solved or not..;)
+ 4
I'm not sure I understand the first part of your question. IMO indentation is an excellent requirement that prevents sloppy writing and was intentionally implemented by Guido with such a purpose in mind. Second - indentation is just a consequence of the program logic. So if you have a problem handling indentation there's a chance you have a problem with the clarity of the logic. BTW:I am convinced such enforced discipline should be a part of all programming languages.
IDEs: there are many - it's a matter of personal preference. The first one that comes to my mind is PyCharm. If you're used to Eclipse then add Python to it. Scientists use Anaconda. This is a hit and miss game.
+ 3
Skipper What exactly IMO indentation is...Is it the solution to the problem which I am facing???
And thanks for helping me out.
+ 3
Skipper thanks ;)
+ 2
Usually you can indent or dedent multiple lines by selecting them and hitting the tab key. A normal text editor will replace the selected text with a tab (not what you want). A python editor like Spyder will indent the selected lines. Same with dedentation (usually Ctrl + tab or Shift + tab).
+ 2
Vansh Wadhwa
Sure.
IMO is an abreviation of "In my opinion" :) and is not any technical term.
I'd suggest you open a new thread - this time with the code snippet that best illustrates the problem you're facing. Or edit your initial input that starts this thread by adding to it such a code.This will make the problem easier for everybody to understand and comment on.
Good luck!
+ 1
Try PyCharm, and IDE from jetbrains. It's free and it is really really good. It also manages the indentation for you, and a whole lot of other great stuff.
+ 1
You probably downloaded the professional version. The community version is free. I'm still using one from 2016
+ 1
Ok Vansh Wadhwa :)