In what concerns the continuous evaluation solving exercises grade during the semester, you should submit until 23:59 of November 23rd
(this exercise will still be available for submission after that deadline, but without counting towards your grade)
[to understand the context of this problem, you should read the class #06 exercise sheet]


In this problem you should submit a function as described. Inside the function do not print anything that was not asked!

[IP048] List Transformation

Moe Szyslak, the famously grouchy bartender of The Simpsons, has been dealing with a new trend among his regulars at Moe’s Tavern. One evening, Comic Book Guy, Professor Frink, and Lisa Simpson are huddled at a corner table, discussing a strange concept they call "list transformation". Moe isn’t exactly sure what it means, but it has something to do with math, and he’s a little annoyed at how it’s taking his regulars' attention away from his drink specials.

The trio explains that they’re debating a mathematical problem where you take a list of numbers and multiply each element by a constant value k. This could be useful, Comic Book Guy suggests, for calculating tips on bills, tallying up loyalty points, or even keeping tabs on how much Homer has been drinking (which, of course, keeps the bill sky-high).

The Problem

Write a function transform(lst, k) that given a list of integers lst changes the list so that each element on the list is multiplied by k.

Constraints

The following limits are guaranteed in all the test cases that will be given to your program:

1 ≤ |lst| ≤ 100       size of the input list
-1000 ≤ lsti ≤ 1000       elements of the list
-1000 ≤ k ≤ 1000       multiplication factor

Example Function Calls Example Output
lst = [1,2,3,4,5]
transform(lst, 2)
print(lst)
transform(lst, 5)
print(lst)
[2, 4, 6, 8, 10]
[10, 20, 30, 40, 50]

Introduction to Programming (CC1024)
DCC/FCUP - University of Porto