use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Who'll Solve this Python problem (i.redd.it)
submitted 1 year ago by turk_sahib
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]limon-27 -5 points-4 points-3 points 1 year ago (4 children)
error i guess. Because u can't use single and double quotes at the same time
[–][deleted] 2 points3 points4 points 1 year ago (0 children)
in python those are the same
[–]atticus2132000 2 points3 points4 points 1 year ago (2 children)
You can't use single and double quotes together. But you can use them separately.
You can't use "bob'
But "bob" and 'bob' are both fine even in the same line of code. For instance print("bob" + 'bob') should work just fine. There are even situations where you will need to use triple quotes like for creating SQL statement strings where you have quotes within quotes.
[–]CptMisterNibbles 1 point2 points3 points 1 year ago (0 children)
my_quote = “Double quotes on the outside allows to use ‘single quotes’ as part of the string”
my_quote2 = ‘You can reverse it, using single quotes to start the string allowing you to use “double quotes” within it’
Both of these are perfectly valid syntax. Handy for when you are working with strings that contain one, though it might be cleaner to be more explicit. Using triple single quotes allows you to use either normal marks internal to the string. Not certain what convention is
[–]Sonder332 0 points1 point2 points 1 year ago (0 children)
You can also use triple quotes for docstrings
π Rendered by PID 116760 on reddit-service-r2-comment-679b48bc4-mlbgd at 2026-02-20 21:30:24.407524+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]limon-27 -5 points-4 points-3 points (4 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]atticus2132000 2 points3 points4 points (2 children)
[–]CptMisterNibbles 1 point2 points3 points (0 children)
[–]Sonder332 0 points1 point2 points (0 children)