0
Why do these apostrophes appear after moving onto the next line?
So I'm just messing around with python (new to all this) and i just saw that >>> input('s') s '' 2 apostrophes are inputted after i move onto my next line I was just wondering why this happens or if i did something for this to happen thanks
1 ответ
+ 4
If you type in a console it basically returns/outputs everything you do, line after line. For input() it repeats what you wrote, treating it always as a string.
Like:
>>> 7+4
11
but:
>>> input(': ')
: 7+4
'7+4'
In this case you asked for the user input. After you press 'Enter' right away the console returns the input string you provided, which in this case was empty. The double apostrophe means this empty string.
If you had entered 'abc', the console would return 'abc' in the next line.