Saved Bookmarks
| 1. |
Someone pls reply, Find the largest all the smallest number in a tuple or list in python |
|
Answer» Task : To find largest and smallest number in a list. Approach : READ input number ASKING for LENGTH of the list using input() or raw_input(). Initialise an empty list lst = []. Read each number using a for loop. In the for loop append each number to the list. Now we use predefined function max() to find the largest element in a list. Similarly we use another predefined function min() to find the smallest element in a list. PLEASE MARK ME AS BRILLIANT AND GIVE ME STARS |
|