Hi I am stuck at near the end of build a calculator, number 38 break 39 is blanck and 41 print("please enter a valid input!!")
number 38 says when i press enter syntax error break outside loop
i am new to all this can someone help please.
break statement is allowed only inside
With your indentation the code from line 17 on belongs to the function
div(), but the
while loop contains only one line.
print("Welcome") is the first line to be executed. Give it no indentation then. Ditto
Following lines need at least one level of indentation in order to belong to the
Oh, and please use 4 spaces to indent, so it looks something like this:
print("welcome!!") while True: user_input=raw_input("enter calculator type:") if user_input=='+': print("to calculate(number1+number2):") add(int(input("enter number1:")),int(input("enternumber2:")))
You can detect faulty indentation so much better then.
You need to indent lines 21 to 38 by one. Select them with your mouse or Shift, and press C-[