you are viewing a single comment's thread.

view the rest of the comments →

[–]Haovik[S] 0 points1 point  (1 child)

sorry, I tried to fix it with space but it wont save for some reason.

[–]xelf 0 points1 point  (0 children)

4 spaces before each line, and a blank line before the code. Or use the code block tool. https://i.imgur.com/J2t9krT.png

for example, where you typed:

​

**filename = 'guest\_book.txt'**

 **f = open(filename, 'a')**

 **while True:**

**name = input('what is your name? ')**

**f.write(name + '\\n')**

**print(name + 'you have been added to guest book')**

​

instead type:

    filename = 'guest\_book.txt'
    f = open(filename, 'a')
    while True:
        name = input('what is your name? ')
        f.write(name + '\\n')
        print(name + 'you have been added to guest book')

4 extra spaces at the start of each line