Python Programming_Week3
1. Write a program “Lab3B” 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 2. Write a program “Lab3B”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. 3. Write a program “Lab3B” 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.
Written for
- Institution
- Python Programming
- Course
- Python Programming
Document information
- Uploaded on
- July 22, 2023
- Number of pages
- 3
- Written in
- 2022/2023
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
pythonprogrammingweek3
Also available in package deal