When do you use space and quotations? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

When do you use space and quotations?

Hi I'm new here! For print hello world we used single quotation marks and for exponentiation we are leaving spaces. Why is that and when do we use either? Thanks.

14th Mar 2021, 11:27 PM
Jacob A.
Jacob A. - avatar
4 Answers
+ 2
Jacob A. Single quotation used for String value. According to your example Hello World is a string so we will write inside single quotes str1 = 'Hello World' Exponentiation (**) is a numeric operation. Space is optional. If you don't want then don't use. Example: You can write either 2 ** 2 or you can write 2**2 both will give same output.
15th Mar 2021, 5:06 AM
A͢J
A͢J - avatar
+ 2
Can you give an example of what you are talking about?
14th Mar 2021, 11:51 PM
Abhay
Abhay - avatar
+ 1
Thanks AJ!
16th Mar 2021, 12:00 AM
Jacob A.
Jacob A. - avatar
0
Add tag of language that your question refer to, and it would be nice to see some piece of code, or at least symbols that you have problem with
15th Mar 2021, 12:26 AM
Michal Doruch