What is the difference between string representation and string double quote representation | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

What is the difference between string representation and string double quote representation

Im confused b/w string representation and double quote string representation

19th Jun 2019, 4:09 PM
Yuvraj Sharan
1 Réponse
0
string in python is representated in 2 formats(as you have mentioned) - ' ' and " " According to principle of programming languages a string is always declared with double qoutes(" "). Single qouted strings are known as character bytes(' '). Basic difference between both is in memory allocation. String is allocated a continous memory of a unique cell in memory. Character bytes also get a continous memory but multiple cells. If you generate 32 bit address code of both character byte and string of same input, you can observe difference. Hope this is helpful🙂
19th Jun 2019, 4:39 PM
Tarun
Tarun - avatar