+ 2
Why the input is double and the output is single string?
4 Antworten
+ 2
Output of the console is always a string in single quotes. But you can declare strings with single or double quotes. Just be careful, when in your string is a quote included, therefore are special rules.
+ 1
thanks everyone
0
Python doesn't care if you use single or double quotes, as long as you use the same type of quotes to start and end your string. Python will just print the string with single quotes since it doesn't make any distinction. If you use quotation marks inside your string, surround it with the other type of quotation marks (single or double) than the ones you used to surround your string, or use a backslash to escape those characters.
0
imagine if u had to give an apostrophe character inside the string,.. (a single single quote).. Then surrounding the whole string with a double quote would be convenient way around.
this is jus a scenario.