Advertisement
OreganoHauch

Not working

Jan 23rd, 2020
267
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. def maxvalue(list):
  2. # filters out only int and float from list:
  3. list_converted = []
  4. for j in range(len(list)):
  5. if type(list[j]) in (int, float):
  6. list_converted.append(list[j])
  7. maxvalue = list_converted[0]
  8. for i in list_converted[1:]:
  9. if list_converted[i] > maxvalue:
  10. maxvalue = list_converted[i]
  11. print("Your list was:\n" + str(list_converted) + "\nIts maximum numeric value is " + str(maxvalue) + ".")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement