QuestionQ85Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionWhich of the following statements is true? Astr1 and str2 are different (but equal) strings.Bstr1 and str2 are different names of the same strings.Cstr1 is longer than str2Dstr2 is longer than str1Show AnswerAnswerExplanationstr2 = str1[:] takes a complete slice of str1. Since strings are immutable, both names refer to the same string value, 'Peter', and the strings have equal length.Show comments1Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion