week3_labA 1 This assignment question is about practicing with Week3 Code Archive. You must strictly follow the submission requirements given below. No Python source code is required for submission;...

python


week3_labA 1 This assignment question is about practicing with Week3 Code Archive. You must strictly follow the submission requirements given below. No Python source code is required for submission; screenshots must be focused on the required portions and their contents must be readable (if not, you will get 0 points)—you may take several screenshots for a certain question; for each question, only a short description (1~2 paragraphs) with screenshots showing your work and testing results required; put all these paragraphs and screenshots in a single Word document (i.e, a .docx file) and the Word file name must be Lab3A.docx. Your submit only this word file Lab3A.docx as your solution for this lab (the paragraphs and screenshots must be in the same order as the questions given below). 1. Download Week3-Code-Archive. Start with learning and testing “list.py”. Make some changes on the cod . Submissions: a. One paragraph regarding list: what is it? Brief description of list functions/methods such as insert(), append(), sort(), reverse() as used in the code. b. One screenshot of your updated code execution. 2. Test and modify “tuple.py”. Submissions: a. One paragraph regarding tuple: i. Discuss several different ways of creating a tuple. ii. What is tuple unpacking and how to do it? iii. What are differences between tuple and list? b. One screenshot of your updated code execution. 3. Test and modify “while.py” and “while_till_bye.py”. Submissions: a. One paragraph: how the while-loop is used in these two programs? The focus would be on the different ways of using while-loop. b. Two screenshots of your updated code executions. 4. Test and modify “for_list.py” and “for_tuple.py”. Submissions: a. One paragraph: how the for-loop is used in these two programs? b. Two screenshots of your updated code executions. 5. Test and modify “dictionary.py”, “dictionary_constructor.py”, and “state_dictionary.py” Submissions: a. One paragraph: i. what is a dictionary, ii. how to create it, iii. how key-value pair is defined/used in the dictionary, iv. list several ways of printing the dictionary, v. how to change value and how to add a field in dictionary. 2 b. Three screenshots of your updated code executions. 6. Test and modify “access_list_tuple.py”, “iterate_list_backwards.py”, and “iterator_samples.py” Submissions: a. One paragraph: i. How to access list/tuple, ii. How to iterate list/tuple backwards, iii. What methods/functions are used to iterate list/tuple which serve as “iterator” functioning. b. Three screenshots of your updated code executions. week3_labB 1 Submission Requirements: • One Word document (the file name must be Lab3B.docx) containing the testing and outputs (i.e., screenshots) of the execution of your Python programs as the solutions for the following questions (items in this Word document must be in the same order as the questions). • Your Python programs (that is, the .py program files)—note that there are specific requirements on the program names. Note: o Your code must be properly commented (like the examples in Code Archive; you don’t have to comment on every line of code.) o On the top of your program, there must be 3~5 lines of the comments of your full name and date/time when you have completed the programs. • (Attach your program files individually; do not zip the programs; do not put the Python code in the Word document.) Q1 (40 points) Write a program “Lab3B01.py” that prompts the user to enter a number in the range 1 to 999.99 (inclusive) and validates the input by using while-loop. Loop until user enters: 555.55. Print the inputted number with 2 decimal places—see the following example. The screenshot of your program execution would look like the following: 2 Q2 (40 points) Write a program “Lab3B02.py”that creates a list of 5 integers (prompting for inputs and add to the list one by one), print the list. Then convert the list to a tuple (simply with use of the function tuple(..) ) and print the tuple in reversed order. You need to use while-loop. Use the following example for your implementation. The screenshots of your program executions would look like the following: 3 Q3 (60 points) Write a program “Lab3B03.py” that lets the user enter the total sales in dollars for each of a week into a list (use a loop for this task). The program should then calculate and display the total sales for the week, the average sales, and which days with the highest and lowest sales. Use a tuple or list to hold weekday names. Use a list to hold the sales per each week. The calculated sales output should be floating number with 2 decimal places. Use the following sample to guide your implementation. Also use while-loop to check the week sales input and for-loop to calculate the total. The screenshot of your program execution would look like the following:
Sep 22, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here