Expected an indented block

A

altugozgercek

Hey guys ! its my first topic and I'm gonna start with a problem :) Im totally beginner in Python and each time I try to run this program it gives me the error down below:

http://imgur.com/ufUAMTs

I'm using Sublime Text, same problems occured in TextWrangler and in Vim too. I tried python3 python.py too nothing has changed. Thanks in advance.
 
C

Chris Angelico

Hey guys ! its my first topic and I'm gonna start with a problem :) Im totally beginner in Python and each time I try to run this program it gives me the error down below:

http://imgur.com/ufUAMTs

I'm using Sublime Text, same problems occured in TextWrangler and in Vim too. I tried python3 python.py too nothing has changed. Thanks in advance.

Without the code, we can't much help. But look at line 3 - it probably
has an if, while, or for statement. Did you write python.py? Did you
copy and paste it from somewhere? If the latter, make sure you retain
indentation, as it's important to Python - and it's not always
possible to figure out how far things should be indented otherwise.

If python.py isn't very large, you'd do well to simply include its
content in-line here. Including the full traceback (as text, not as an
image) is also extremely helpful. In a few years, this list/newsgroup
thread will be being read by hundreds or thousands of people, not all
of whom will want to click web links to figure out what you're saying
- and that's assuming imgur is still holding your image, which I'm not
sure is guaranteed. Text is reliable!

ChrisA
 
J

John Gordon

In said:
Hey guys ! its my first topic and I'm gonna start with a problem :) Im
totally beginner in Python and each time I try to run this program it
gives me the error down below:

That error involves the previous program line, which your screenshot
doesn't show, so it's hard to say exactly what the problem is.

However, I'll take a guess that the previous line is an "if" statement,
which requires that the following line be indented. Did you indent the
print statement?

This error can also be caused by using a mix of tabs and spaces on the
same line. Don't do that.

(And by the way, it's generally better to post errors and code as text
instead of a screenshot.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top