Reputation: 3
i'm a beginner, and i have just started using python on ubuntu. the code given below has been edited twice to weed out the indentation errors, but the same error persists.
try:
f = int(data['value'])
print (f)
if f > max or f < min:
response =print("done!")
except Exception as e:
print ("Error",e)
it says that the error is in the if statement and the error is "inconsistent use of tabs and spaces in indentation"
Upvotes: 0
Views: 239
Reputation: 1495
Well, the except
should be at the same "height" or level as the try
. You also had an extra indentation on the try sector! Remember, python works with indentation only, no {}
are used!
try:
f = int(data['value'])
print (f)
if f > max or f < min:
response =print("done!")
except Exception as e:
print ("Error",e)
Upvotes: 2