Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python map function using lambda function as one of the parameters

grade_list = [3.5, 3.7, 2.6, 95, 87]

# Your code below:
grades_100scale = map(lambda a : a*25 if a < 4.0 else a, grade_list)
# assign the result of your map function to the variable grades_100scale

# convert grades_100scale to a list and save it as updated_grade_list 
updated_grade_list = list(grades_100scale)
# print updated_grade_list
print(updated_grade_list)
Comment

PREVIOUS NEXT
Code Example
Python :: not want to assign all values of a collection of values in python 
Python :: substring in python 
Python :: instal django impoer expor 
Python :: add variable in text python 
Python :: python dataframe copy structure 
Python :: list into string python 
Python :: df filter out rows that appear more than x times 
Python :: python list all youtube channel videos 
Python :: jupyter notebook loading bar 
Python :: subplots whitespace 
Python :: programação orientada a objetos python - Pessoa 
Python :: Disable console messages in Flask server 
Python :: django listview 
Python :: Python - Comment préparer la capitalisation 
Python :: how to import autpy 
Python :: Parsing a url for IP address using python 
Python :: pep8 E302 
Python :: django auto complete light styling 
Python :: os.system ignore output 
Python :: implementing a bubble sort in python 
Python :: handle dict invalid key python 
Python :: flask new response style with `make_response` 
Python :: multi hot encode pandas column 
Python :: Fernet: Cannot decrypt strings saved in csv with pandas 
Python :: convert an image to matrix in python 
Python :: python image resize 
Python :: (Word or Phrase to Phone-Number Generator) python 
Python :: How to multiply a text in python 
Python :: make a coo_matrix 
Python :: Streaming upload requests python 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =