Question: 2 Functions and List Comprehensions 1. Write a function called oddCuberoot(). The function takes in a number and returns its cube-root if the number is

 2 Functions and List Comprehensions 1. Write a function called oddCuberoot().

2 Functions and List Comprehensions 1. Write a function called oddCuberoot(). The function takes in a number and returns its cube-root if the number is odd and greater than zero, otherwise, print a statement that the number is zero or even, or negative. 2. Use list comprehensions to gather all even numbers from the list below into a new list called even_numbers. numbers =[10,3,4,6,35,9,3,12]. 3. write a lambda function to compute the logarithm of any number 4. Given the string my_string = "Will I succeed if I tried that trick?", use list comprehension to perform the following tasks: (a) remove any short words (containing 2 or fewer characters) (b) convert all the returned characters to lowercase (c) Return the modified string as a new list 5. Write a function that takes a list and returns a new list with unique elements of the first list. As an example, test it on [1,2,3,3,4,5,5,6] and it should return [1,2,3,4,5,6] 6. Asuume that hotel room costs are constant at $140 per night in the cities mentioned below. Airfares, in dollars, to these cities from your location are: "Charlotte": $183, "Tampa": $220, "Pittsburgh": $222,"Atlanta": $475. The rental car costs $40 per day. Spending money required =$X per day, depending on the user. Write separate functions to: (a) compute hotel cost based on the number of days of stay (b) determine airfare based on the city (c) compute the rental car cost based on the number of days of stay (d) calculate total trip cost based on city, days, and spending money as inputs from users 7. message = "!XeXgXaXsXsXeXmX XtXeXrXcXeXsX XeXhXtX XmXaX XI" is an encoded message string. Use any method you have learned so far to unlock the message based on the following information: the message is backward, and the letter ' X ' is unwanted. Submission: Push your work to GitHub and confirm it's on there. Then, mark the assignment as complete on ELC and put the message of your last commit in the text box of the submission page. For example, if your last commit is git commit -m "finished Assignment 6 decoding problem", put this message in ELC when you mark your assignment as completed

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!