You are given a file “data.txt” that contains words from the English Language. The text is stored in the file as one sentence per line. The contents of the file is similar to the following image: Write Python code that does the following: Read the contents of the file and store each word in a list called data. From the data list, create a list called that length_six such that each word in length_six has length 6.
Blog
Given the Selection Sort algorithm studied in class, use the…
Given the Selection Sort algorithm studied in class, use the following list to show the contents of the list for the first three passes of the algorithm. There is no need to explain the algorithm – you only need to write down the contents of the list for each pass on a separate line. 11 7 32 -19 -5 -21 1
The output of the following question is _____________. this_…
The output of the following question is _____________. this_list = [‘Roses’, ‘are’, ‘red’]print(this_list[::-1])
Given the Selection Sort Algorithm covered in Module 07 B (c…
Given the Selection Sort Algorithm covered in Module 07 B (consider ascending order sorting, that is, smaller values are followed by larger values) and the list of integers called values given below, show how each of the next three passes of the algorithm changes the list values. How many swaps did you make in total in these passes? values = [-2, 0, 3, 9, 11, 5, 16]
What is the output of the following code? numbers = [1, 2, 3…
What is the output of the following code? numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]print(numbers[::2])
What is the output of the following code? numbers = [1, 2, 3…
What is the output of the following code? numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]print(numbers[3:6:1])
Write a Python program that contains a function called creat…
Write a Python program that contains a function called create_list that accepts two arguments: a list called values, and a number n. Assume that the list values contains numbers. The function should create and return a list of numbers in the values list that are greater than the number n. Call the create_list() function so that it can return all elements in the following list that are greater than 35. Print out the list of numbers that create_list() returns. numbers = [19, 22, 45, 36, 25, 44, 49, 29, 50, 47]
Given 16 oz = 1 lb. Make the indicated conversion within Ame…
Given 16 oz = 1 lb. Make the indicated conversion within American units of weight. 11 pounds to ounces 11 lb = ____ oz
Divide. Show your work on your scratch paper to receive cred…
Divide. Show your work on your scratch paper to receive credit. Round the answer to the nearest tenth. 3.44
A case of 4 items costs $7.12 at Costco. What is the price o…
A case of 4 items costs $7.12 at Costco. What is the price of each item? Type an integer or decimal in the box below. Show your work for full credit.