748 views
1 1 vote
Is there any big difference between ingle quotation (' ') and double ("") quotation in Python?
25% Accept Rate Accepted 1 answers out of 4 questions

1 Answer

2 2 votes

A string as a sequence of characters not intended to have numeric value. In Python, such sequence of characters is included inside single or double quotes. As far as language syntax is concerned, there is no difference in single or double quoted string. Both representations can be used interchangeably. However, if either single or double quote is a part of the string itself, then the string must be placed in double or single quotes respectively.

For example a text Hello “Python” is to be stored as a string, then one should use:

str1='Hello "Python"'

On the other hand, if string should resemble Hello ‘Python’ then it should be declared as follows:

Str2="Hello 'Python'"

source

Related questions

0 0 votes
1 1 answer
687
687 views
1 1 vote
1 1 answer
690
690 views
1 1 vote
1 answers 1 answer
6.5k
6.5k views
0 0 votes
0 0 answers
533
533 views
Ziva asked Jul 31, 2020
533 views
https://ibb.co/MgXvrkL
2 2 votes
1 1 answer
891
891 views