1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Programming Paradigms

Exercise

Write a pure function

It's time to write your first pure function! You've been working with some data that contains price information for all of the items in your company's inventory. What you didn't realize when you started, however, was that all of the price information is in cents when you expected it to be in dollars. You are going to need to write a function to convert all of the prices from cents to dollars by dividing the values by 100. Make sure you don't create any side effects or rely on any values outside of the function!

Instructions

100 XP
  • Complete the code below to write a pure function that takes a list (input_list) as input, divides each item in the list by 100, and then returns the new list.