Brand new to python. When using the map function in python, i get a series of the word "none" as an output when i run my function. ive added screenshot below.
Code
def rawGradeToLetter(grade):
if grade >= 90:
print ("A")
elif grade < 90 and grade >= 80:
print ("B")
elif grade < 80 and grade >= 70:
print ("C")
elif grade < 70 and grade >= 60:
print ("D")
elif grade < 60:
print ("F")
def convertRawsToLetters(myList):
return list(map(rawGradeToLetter, myList))
Example run:
>>> convertRawsToLetters([90,80,70])
A
B
C
[None, None, None]
I have a feeling it has something to do with the word list before the map function, but if I remove that all I get is the address of the map like "map object at 0x8g9b7ea51950".