[Tutor] python lists/nested lists

Soliman, Yasmin ysoliman at uncc.edu
Sat Apr 13 22:53:29 CEST 2013


How can I calculate the average of a list of numbers (eg [2,5,8,7,3] ) and then subtract the avg from the original numbers in the list and print? 

Also, if I have a nested list: 
sick_patients=[['Sam', 'M', 65, 'chest pain', 101.6], [['Sarah', 'F', 73, 'dizziness', 98.6], [['Susie', 'F', 34, 'headache', 99.7], [['Scott', 'M', 12, 'stom ache', 102.3]

and I would like to print out all the patients with a temp > 100 how would I do so?


More information about the Tutor mailing list