Question: in python please Exercises 7/8 If these examples are making sense, go ahead and try to do the following exercises using comprehensions. If not, try
in python please


Exercises 7/8 If these examples are making sense, go ahead and try to do the following exercises using comprehensions. If not, try the exercises without comprehensions. You may figure out how to use comprehensions after you have solved each exercise the longer way. Multiples of Ten . Make a list of the first ten multiples of ten (10, 20, 30... 90, 100). There are a number of ways to do this, but try to do it using a list comprehension. Print out your list. Cubes We saw how to make a list of the first ten squares. Make a list of the first ten cubes (1, 8, 27... 1000) using a list comprehension, and print them out. Awesomeness Store five names in a list. Make a second list that adds the phrase "is awesome!" to each name, using a list comprehension. Print out the awesome version of the names. Working Backwards Write out the following code without using a list comprehension: plus_thirteen = [number + 13 for number in range(1,11)] top Exercises 8/8 Listing a Sentence . Store a single sentence in a variable. Use a for loop to print each character from your sentence on a separate line. Sentence List Store a single sentence in a variable. Create a list from your sentence. Print your raw list (don't use a loop, just print the list). Sentence Slices Store a sentence in a variable. Using slices, print out the first five characters, any five consecutive characters from the middle of the sentence, and the last five characters of the sentence. Finding Python Store a sentence in a variable, making sure you use the word Python at least twice in the sentence. Use the in keyword to prove that the word Python is actually in the sentence. Use the find() function to show where the word Python first appears in the sentence. Use the rfind() function to show the last place Python appears in the sentence. Use the count() function to show how many times the word Python appears in your sentence. Use the split() function to break your sentence into a list of words. Print the raw list, and use a loop to print each word on its own line. Use the replace() function to change Python to Ruby in your sentence
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
