Search code examples
pythoninputenter

How can I press enter to go on a new line?


Say if I did:

print("hello")
print("nice to meet you!)

What I wanted it to do output is:

  hello

then you press the enter key and then it does the print("nice to meet you!").

(I am making a subtitle story type thing.)

I tried input() but that allows text input when I only want I to allow the Enter key. I don't know if if could do a detect key pressed or something.


Solution

  • You should try doing same

    print ('hello')
    input('Input some value: ')
    print('nice to meet you!')