Need help!


I just finished the pyglatin part of the tutorial and got a little excited.

I tried writing my own code in a sort of similar way to the final pyglatin program but mine is to calculate food price. Im curious to see if my code is brutally off because I’m not sure what I did wrong, I’m still new to this and really want to learn programing!

It says indentation error on line 4 and I’m not sure how to fix

print "Food calculator"
food = raw_input(“How much was the food?”)
if food.isalpha() or 6 > 9:
print "enter an actual number"
tip = raw_input(“What do you want to tip?”)
if tip.isalpha() or 6 > 9:
print "please enter a actual number"
tip = tip / 100
tip_food = food + food * tip
tax = 13 / 100
final_food = tip_food + tip_food * tax
print final_food


Check your indentations.

Going by your current code, the two if statements aren’t children to anything, so they shouldn’t be indented.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.