why is ap and apple next to each other without empty space between them(in output)
def FirstExample():
object = input("What kind of object? ")
with open("5.1.txt","a") as f:
f.write(f"{object}\n") # \n so that it writes every new line
with open("5.1.txt", "r") as f:
print(f.read()) # You can read a file only in "r" mode, you can't do that in "a" for example
f.seek(0)
print(f.read(10))
f.seek(0)
print(f.readline(2))# Reads up to 2 characters from the current line
f.seek(0)
print(f.readline())
f.seek(0)
for _ in range(3):
print(f.readline(), end="")
FirstExample()