Python assignment
- py (30 points)
Write a program that will except a range of 20 numbers from the user and then populate the list with entered numbers. It will also calculate the min. max, total, and average (math functions) of those numbers.
Hints:
Define main () program
Create number_list (This list will contain how many number you want your program to loop through)
Declare variables
Use a For loop to populate the number_list.
Print out the min. max, total, and average formatted with 2 decimal precisions.
- py (40 points):
Write a program that will read a data file calculates which contains sentences (text file). Then count the total number of words in the file. Calculate the average and print it out.
Hints:
Define main() program
Declare variables
Save the given data file under the same folder as your program file is
Open file
User infile.readlines() to read data into a list of sentences (Each item in the list is one sentence)
Use len(sentence_list) to get length of the sentence list. (num of sentence is equal to the length of sentence list
Use a For loop to number of items (word) in the sentence. For loop will collect the Total words.
Calculate the average and print
- py (30 point)
Write a program to read a text file. Determine if the character is uppercase, lowercase, a digit, or space, and keep a running total of each.
Hints
Define main() program
Declare variables
Save the given data file under the same folder as your program file is.
Open file
Use a For loop to read data and verify with if statement or if/elif statement
Print out the total of is uppercase, lowercase, a digit, and space characters in the file
7 years ago 20
Purchase the answer to view it
- madara10.zip
- Competitive Advantage and Globalization
- one page paper apa style
- GDP Calculation
- ana
- role of marketing in society
- ACCT 311 Quiz 3 (Chapter 19, 20) Summer 2014
- WEEK 3 FIN DISCUSSION
- MGT/488 MGT 488 MGT488 Week 2 - Learning Team Assignment - Virtual Organization Selection Paper - A+ & Original Guaranteed from an A+ rated tutor!
- MGT/498 MGT 498 MGT498 Entire Course - Weeks 1-5 - All Individual, DQs, and Team Assignments - A+ & Original Guaranteed!
- Quicksolutionz4u