Python_Institute
PCEP-30-02 · Question #374
Which of the following sentences is true? str1 = 'Peter' str2 = str1[:]
The correct answer is B. str1 and str2 are different names of the same strings. See the full explanation below for the reasoning.
Question
Which of the following sentences is true?
str1 = 'Peter'
str2 = str1[:]
Options
- Astr1 and str2 are different (but equal) strings.
- Bstr1 and str2 are different names of the same strings.
- Cstr1 is longer than str2
- Dstr2 is longer than str1
How the community answered
(24 responses)- A17% (4)
- B71% (17)
- C8% (2)
- D4% (1)
Community Discussion
No community discussion yet for this question.