QuestionQ66Verified/Data Collections – Tuples, Dictionaries, Lists, and StringsCopy linkReport a problemAsk AstroTutorSave questionHow many elements does the following list have? data = [i for i in range(-1, 2)] AoneBtwoCzeroDfourEthreeShow AnswerAnswerExplanationPython’s range(-1, 2) yields the integers -1, 0, and 1; its ending value is excluded. The list comprehension therefore creates three elements.Show comments0Show commentsCommunity DiscussionNo comments yet. Be the first to start the discussion!
Community Discussion