0
Help me please. Code the python using For loop to produce min,max,and average by list x=[16,50,22,49,15,64,58]
3 Answers
+ 1
Store the first element in a variable assuming it's max ,then create a for loop to iterate over the rest of elements in list not including first one .
In for loop compare that max element with each element in list using less than equal to operator ,if it returns True simply assign current value (that you are comparing with) to max variable. Do same for min and for average ,sum the elements in for loop and then divide it by no.of elements
0
Can you help me just write python code? please
0
Fariz Ghina if you show what you have coded so far I can assist you, instead of writing code for you ,but from your statement it seems like even this sounds much difficult for you ,
if that's the case you can go through basics of python,
https://www.sololearn.com/Course/Python/?ref=app
If not ,I explained enough or provided a solution as a pusedocode to get you started with