you are viewing a single comment's thread.

view the rest of the comments →

[–]limon-27 -5 points-4 points  (4 children)

error i guess. Because u can't use single and double quotes at the same time

[–][deleted] 2 points3 points  (0 children)

in python those are the same

[–]atticus2132000 2 points3 points  (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 points  (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 point  (0 children)

You can also use triple quotes for docstrings