Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Single quotes are used to define literal string values -- they are immutable. Do

ID: 3738335 • Letter: S

Question

Single quotes are used to define literal string values -- they are immutable. Double quotes permit globbing and filename expansion, among other properties.
True or False
Single quotes are used to define literal string values -- they are immutable. Double quotes permit globbing and filename expansion, among other properties.
True or False
Single quotes are used to define literal string values -- they are immutable. Double quotes permit globbing and filename expansion, among other properties.
True or False

Explanation / Answer

ANSWER:-

TRUE

Python strings are "immutable" which means they cannot be changed after they are created (Java strings also use this immutable style). Since strings can't be changed, we construct *new* strings as we go to represent computed values. So for example the expression ('hello' + 'there') takes in the 2 strings 'hello' and 'there' and builds a new string 'hellothere'.

In python double quotes permit globbing and filename expantion among other properties