Solved

Consider the Following Code: in [1]: S1 = 'Happy

Question 7

Multiple Choice

Consider the following code: In [1]: s1 = 'happy'
In [2]: s2 = 'birthday'
In [3]: s1 += ' ' + s2
In [4]: s1
Out[4]: 'happy birthday'
In [5]: symbol = '>'
In [6]: symbol *= 5
In [7]: symbol
Out[7]: '>>>>>'
Which snippet(s) in this interactive session appear to modify existing strings, but actually create new string objects?


A) Only snippet [3].
B) Only snippet [5].
C) Both snippets [5] and [6].
D) Both snippets [3] and [6].

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions