Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def maxvalue(list):
- # filters out only int and float from list:
- list_converted = []
- for j in range(len(list)):
- if type(list[j]) in (int, float):
- list_converted.append(list[j])
- maxvalue = list_converted[0]
- for i in list_converted[1:]:
- if list_converted[i] > maxvalue:
- maxvalue = list_converted[i]
- 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