Based on the exact code presented the correct answer is B, if you remove the ']' from the code obviously the answer becomes [3,1] BUT the fact is ']' exists in the code so you must select B as the correct answer and nor speculate on 'what if's'
In [89]: mylist = [ i for i in range(5)]
In [90]: mylist
Out[90]: [0, 1, 2, 3, 4]
In [91]: m = [mylist[i] for i in range (4,0,-1) if mylist[i] % 2!=0 ]
In [92]: m
Out[92]: [3, 1]
This section is not available anymore. Please use the main Exam Page.PCAP Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
seaverick
1 year, 3 months agokstr
1 year, 5 months agoJanpcap123
1 year, 8 months agoandr3
2 years, 1 month agoNenggg
2 years, 4 months agorotimislaw
2 years, 5 months agopablohm83
2 years, 7 months agomacxsz
3 years agorocky48
3 years agosadako11
3 years, 2 months agorocky48
3 years agoDTL001
3 years, 4 months agoDTL001
3 years, 4 months agokungtabumi
3 years, 6 months ago