Question: Python Write list comprehensions to create the following lists: i. Given a function square(), use it to square each number in numlist where: numlist =
Python
Write list comprehensions to create the following lists: i. Given a function square(), use it to square each number in numlist where: numlist = [1,2,3,4,5] ii. Write code to capitalise the first letter of each word in a list of words (wordlist) (Hint: you can use "+" to put the word back together) iii. Create a new list called "newlist" out of the list "numbers", which contains only the positive numbers from the list, as integers numbers = [25, 76, -1, -23, 12]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
