# YOUR CODE GOES HERE
a='introduction\n'
b=input("name \n")
c=input("voorname\n")
rapport=open("rapport.txt", 'w').writelines(a)
rapport=open("rapport.txt", 'a').writelines(b)
rapport=open("rapport.txt", 'a').writelines(c)
Add the new line character. Also, you could open the file once.
a='introduction\n'
b=input("name \n")
c=input("voorname\n")
with open('rapport.txt', 'w') as infile:
infile.writelines(_ + '\n' for _ in (a, b, c))
Thanks you so much
There isn’t a separate “input type”. Using the input
function gives you a perfectly ordinary string. The issue is because this string doesn’t have a newline at the end. In your code example, the string named a
has a newline at the end, because it was written right there in the string literal: 'introduction\n'
. But input
will not leave a newline at the end of the string that it reads, so you have to add one yourself.