Mar-18-2019, 11:36 AM
(Mar-18-2019, 11:17 AM)samsonite Wrote: Simply that Python2 doesn't accept the single quotation mark, as I've said. By adding one more mark, Python2 works properly. Easy to verify, try it!
Well, it's really easy to show that it works with a single quote and NOT work with double single quotes when you pass something taht input will consider variable name:
Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> your_name = input("What''s your name?") What''s your name?Billy Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 1, in <module> NameError: name 'Billy' is not defined >>> your_name = input("What's your name?") What's your name?1 >>> your_name 1 >>> your_name = input("What's your name?") What's your name?[1, 2, 3] >>> your_name [1, 2, 3] >>>
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs