Answered step by step
Verified Expert Solution
Question
1 Approved Answer
a = [0,1,2,3] for a[-1] in a: print(a[-1]) The out put for this is 0 1 2 2. I don't understand. Isn't a[-1] equal three?How
a = [0,1,2,3] for a[-1] in a: print(a[-1])
The out put for this is 0 1 2 2. I don't understand. Isn't a[-1] equal three?How is the output not 3? Also, I understand "for i in a", but have a hard time understanding what does it mean by for a[-1] in a.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started