Introduction to Programming using Python 1st Edition

Published by Pearson
ISBN 10: 0132747189
ISBN 13: 978-0-13274-718-9

Chapter 10 - Lists - Section 10.2 - List Basics - Check Point - MyProgrammingLab - Page 324: 10.12

Answer

(a) List=[False for i in range(100)] (b) List[-1]=5.5 (c) print(List[0]+List[1]) (d) Sum=List[0]+List[1]+List[2]+List[3]+List[4] (e) print(min(List)) (f) print(List[random.randint(0,len(List)-1)])

Work Step by Step

(a) Creating the list using generator (b) Using the negative indexing to change last element (c) Printing the sum of first two elements (d) Calculating the sum of first five elements (e) Using built-in function min to find the minimum element in the list. (f) Using random library's function to generate the random index and printing the element at that index.
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.