I want to change multiple array values from numeric to strings based on the condition that values greater than 70 will become 'P' while values less than 70 will become 'F'. For example: [20,80,30,100]
should become ['F','P','F','P']
and [50,60,90,45]
should become ['F','F','P','F']
.
Current code:
def grade(input_array):
a = len(input_array)>70
return 'P','F'
grade([50,85,60,100])
Current output:
('P', 'F')