while True:
x = raw_input()
if x =="personal information":
print' Edward , Height: 5,10 , EYES: brown , STATE: IL TOWN: , SS:'
elif x =="journal":
name_of_file = raw_input("What is the name of the file: ")
completeName = "C:\\python\\" + name_of_file + ".txt"
file1 = open(completeName , "w")
toFile = raw_input("Write what you want into the field")
file1.write(toFile)
file1.close()
else:
break
the script keeps on giving me an error saying break is outside the loop are the indentations wrong?
No it is not an identation error. You normally "break" out of the loop. The else part in the while statement is not a loop construct. You will find the same error if you do
Yes, look at your post. Your
else
probably is meant to go with theif
statement's indentation level.else
statements forwhile
statements do entirely different things.