I'm new here, can someone explain me the difference of (“ ”) and (' ') in terms of putting word | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

I'm new here, can someone explain me the difference of (“ ”) and (' ') in terms of putting word

20th Feb 2022, 5:25 AM
lorensaron mercado
23 Answers
+ 11
Python does not have that restriction of single quotes for chars and double quotes for strings. As you can see here the grammar explicitly allows both for strings.
20th Feb 2022, 5:29 AM
A J
A J - avatar
+ 11
lorensaron mercado In python and JavaScript we don't need to define data type so single quotes (' ') or double quotes (" ") doesn't matter But in some languages (like Java) it is necessary to define data type so single quotes (' ') is used for char data type and double quotes (" ") is used for string
20th Feb 2022, 8:34 AM
A͢J
A͢J - avatar
+ 3
There is no difference
21st Feb 2022, 4:57 PM
Jamshidbek Sobirov
Jamshidbek Sobirov - avatar
+ 2
In python there is no such differences between the two whereas in java ' ' is for char. And " " is for string.
20th Feb 2022, 3:26 PM
Aaruni Tiwari
Aaruni Tiwari - avatar
+ 2
They both do exactly the same thing.
21st Feb 2022, 3:50 PM
Joshua Travis
Joshua Travis - avatar
+ 2
Use double quote (“ “ )when the word to put in the quotation mark has single quote already …and use single (‘ ‘)quote when the word to put in the quotation mark has double quote already. Print ( “ ‘Hello World’ “) Print ( ‘ “Hello World” ‘)
21st Feb 2022, 7:10 PM
Eddy Cool
Eddy Cool - avatar
+ 2
There is no difference between the both in python
21st Feb 2022, 10:08 PM
Oyindamola
+ 2
You can use ' ' on string that contains " " and use " " on string that contains ' ' inside. for example if you want to print this html line <div style="height : 30px ">........<div> In this case we will use ' ' to not interrupted with the "" inside the string value
22nd Feb 2022, 12:06 AM
Ismail Achouch
Ismail Achouch - avatar
+ 2
They are the same, two quotes and one quote is only fuctioned by print. They also make a speach on the output!
22nd Feb 2022, 3:00 AM
Bluegray
Bluegray - avatar
+ 1
There is no difference at runtime. Just a difference in style.
20th Feb 2022, 5:36 AM
A J
A J - avatar
+ 1
C++ Answer : " for string, ' for char
20th Feb 2022, 7:47 PM
Gurseerit Singh Chahal ✓
Gurseerit Singh Chahal ✓ - avatar
+ 1
Hye everyone! I am new here in kotlin course. So anyone from here can help me?
21st Feb 2022, 8:06 AM
Muhammad Ahmad
+ 1
They’re the same in print function
21st Feb 2022, 9:41 AM
Susu Ice cream
+ 1
They actually do the same thing , unlike other languages that use the single quotes for char and double quotes for string.
21st Feb 2022, 12:21 PM
Pythøñ Cúltîst⚔️🔥🇳🇬
Pythøñ  Cúltîst⚔️🔥🇳🇬 - avatar
+ 1
They are both used for the same purpose
21st Feb 2022, 3:06 PM
Martins Michael
Martins Michael - avatar
+ 1
In Python double quote and single quote are used for same purpose of printing strings in output. But sometimes we want to print something in quotes , in that situation both quotes are used. For example: if we want to print - he is 'king'. We required following code: Print (" he is 'king'.") Hope this will help you to understand
21st Feb 2022, 3:52 PM
Prathamesh Pisal
Prathamesh Pisal - avatar
+ 1
Lee6680 Where's your thought process? :)
21st Feb 2022, 7:47 PM
l4t3nc1
l4t3nc1 - avatar
+ 1
They're honestly the same thing, use what you like
22nd Feb 2022, 1:20 AM
Fiji Helwa
0
https://code.sololearn.com/cbHSL39B81Q7/?ref=app When you make like this, "is using
21st Feb 2022, 7:59 AM
Chris