Python program with .py extension discussion Lab Assignment 5:Create a word processing file that contains your answers to Algorithm Workbench questions 1,
Python program with .py extension discussion Lab Assignment 5:Create a word processing file that contains your answers to Algorithm Workbench questions 1, 2, 3, 5, and 7 at the end of Chapter 7. (50 points)Name this file “XYLab5”, where “X” and “Y” are your first and last initials.Create a Text file with a “.py” file extension that contains your proposed solution to Programming Exercise 3, Rainfall Statistics, at the end of Chapter 7. (50 points)Name this file “XYLab5.py”, where “X” and “Y” are your first and last initials. 402 Chapter 7 Lists and Tuples
5.
If y
a fil
par
as
w
as
th
sh
Algorithm Workbench
1. Write a statement that creates a list with the following strings: ‘Einstein’, ‘Newton
Copernicus’, and ‘Kepler’.
2. Assume names references a list. Write a for loop that displays each element of the list
3. Assume the list numbers 1 has 100 elements, and numbers2 is an empty list. Write code
that copies the values in numbers 1 to numbers2.
4. Draw a flowchart showing the general logic for totaling the values in a list.
5. Write a function that accepts a list as an argument (assume the list contains integers)
and returns the total of the values in the list.
6. Assume the names variable references a list of strings. Write code that determines
whether ‘Ruby’ is in the names list. If it is, display the message ‘Hello Ruby
Otherwise, display the message ‘No Ruby’.
7. What will the following code print?
list1 = [40, 50, 60]
list2 = [10, 20, 30]
list3 = list1 + list2
print(list3)
8. Write a statement that creates a two-dimensional list with 5 rows and 3 columns. Then
write nested loops that get an integer value from the user for each element in the list
P ?
(
Programming Exercises
1. Total Sales
Programming Exercises
1. Total Sales
Design a program that asks the user to enter a store’s sales for each day of the week. The
amounts should be stored in a list. Use a loop to calculate the total sales for the week and
display the result.
gener
2. Lottery Number Generator
Design a program that generates a seven-digit lottery number. The program
program should
ate seven random numbers
, each in the range of 0 through 9, and assign each number to a
list element. (Random numbers were discussed in Chapter 5.) Then write another loop thar
displays the contents of the list.
3. Rainfall Statistics
Design a program that lets the user enter the total rainfall for each of 12 months into a
list. The program should calculate and display the total rainfall for the year, the average
monthly rainfall, the months with the highest and lowest amounts.
4. Number Analysis Program
Design a program that asks the user to enter a series of 20 numbers. The program should
store the numbers in a list then display the following data:
The lowest number in the list
. The highest number in the list
The total of the numbers in the list
The average of the numbers in the list
Purchase answer to see full
attachment
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.