Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14243

python-shell on linux system indentation error [duplicate]

$
0
0

I am a newbie in python and using the python shell through a linux system. I enter the python shell by typing "python" at the command line. When i try to execute a for-loop from the python shell, the shell does not allow me to further continue with indentation and sends File "", line 2 error. Please check the code below;

ash-4.1$ pythonPython 2.6.6 (r266:84292, May 22 2015, 08:34:51)[GCC 4.4.7 20120313 (Red Hat 4.4.7-15)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>> word=("cheese")>>> word'cheese'>>> for character in word:... print(character)  File "<stdin>", line 2    print(character)        ^IndentationError: expected an indented block>>>

Also the version installed on this linux system is 2.6. Can you please help me how to work through this?


Viewing all articles
Browse latest Browse all 14243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>