How can I get the highest number from a give array | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How can I get the highest number from a give array

I have an array of numbers and i want to establish the highest number. Further more i want to determine which if the numbers is below average if am given an average mark x

17th Oct 2018, 8:57 PM
Nelson Mandela
Nelson Mandela - avatar
2 Answers
+ 1
for python: numbers = [1,2,3,...] highest_number = max(numbers) below_average = [num for num in numbers if num < mark_x]
17th Oct 2018, 10:32 PM
Kevin Dietrichstein
Kevin Dietrichstein - avatar
0
Hey thanks Kevin. The solution worked for me.
18th Oct 2018, 5:12 AM
Nelson Mandela
Nelson Mandela - avatar