Question: In Python, 1.Youre given the following list: x = [5, 2, 7, 11, 44, 256, 81, 0, 36]. Write a program that takes list x

In Python,

1.Youre given the following list: x = [5, 2, 7, 11, 44, 256, 81, 0, 36]. Write a program that takes list x and makes a new list that has only the odd elements of this list in it. You should be able to write one line of code to solve it, but more lines is OK, too. 2.Write a function that takes a list of numbers (for example x = [5, 2, 7, 11, 44, 256, 81, 0, 36]) and makes a new list of only the first and last elements of the given list. Test your function. 3.Take a list, say for example, this one: x = [5, 2, 7, 11, 44, 256, 81, 0, 36] and write a program that prints out all the elements of the list that are less than 9. Instead of printing the elements one by one, make a new list that has all the elements less than 9 from this list in it and print out this new list. Write this in one line of Python, if you can figure out how.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!