Answers for "map function to change type of element in python"

2

mapping in python string

# mapping function
def uppercase(u):
    return str(u.upper())

map_iterator = map(uppercase,['a','b','c'])
mylist = list(map_iterator)
print(mylist)
Posted by: Guest on April-19-2020
0

map function to change type of element in python

nums = ['3','4','7']
nums = list(map(int, nums))
print(nums)
Posted by: Guest on August-07-2020

Code answers related to "map function to change type of element in python"

Python Answers by Framework

Browse Popular Code Answers by Language