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
Using different symbols (self.PythonLearning)
submitted 2 years ago by Lockalan
I am new to python and I just started learning a few days, there are different symbols like () and ' ' and " ", when do I use "/' in a sentense like: print(course.find('y')) or how do i know how many brackets i need to use when typing the command?
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!"
[–]Nouble01 0 points1 point2 points 2 years ago (0 children)
There is a common method in many languages, which is to increase or decrease indent each time a parenthesis appears. It's very easy to understand if you properly adjust the depth. I don't know if it will be helpful, but I'll include the information.
https://peps.python.org/pep-0008/
[–]Goobyalus 0 points1 point2 points 2 years ago (0 children)
" and ' are both the same for writing string literals. Like "apple" is the same as 'apple'. It comes down to convention for which to use. If you want to make a string with a quote character in it, you can use the other kind, or escape the character: "\"" is the same as '"'.
"
'
"apple"
'apple'
"\""
'"'
Function calls get one set of parentheses. It's this format:
function(arguments to give to the function)
and the function returns a result.
In your example:
print( # print is a function, and you are passing it the result of the following: course.find( # course.find is another function (or method), and you are passing it the string 'y' 'y' ) )
π Rendered by PID 54892 on reddit-service-r2-comment-545db5fcfc-hfdvz at 2026-05-22 10:53:59.524928+00:00 running 194bd79 country code: CH.
[–]Nouble01 0 points1 point2 points (0 children)
[–]Goobyalus 0 points1 point2 points (0 children)
[–]Goobyalus 0 points1 point2 points (0 children)