SlideShare a Scribd company logo
The purpose of this assignment is to give you practice with writing loops and introduce you to
lists. Problem Write a program that receives a series of numbers from the user and allows the
user to press the Enter key to indicate that inputs are done. As each number is input, it is stored
into a list. After the user presses the Enter key (i.e., they enter nothing as input), the program
should do the following: - If the list has no elements, just prints "Empty List". - If the list has at
least one element, you must print: The total number of items in the list The list itself sorted in
ascending order. The sum of all the elements in the list. The average of the elements in the list.
The largest value in the list. - The smallest value in the list. - The first half of the list. (If the list
has an odd number of elements, you can exclude the middle element. For example, if there are 5
elements, just print the first 2.) Each individual list element. You must use a loop to iterate
through the list to print each element, and each element must be separated by a tab character (V).
Inputs Any input other than a number or the Enter key should be caught using an exception with
an appropriate error message and the program should continue seeking input. Comments Make
sure your code is sufficiently commented! In this case, you'll want to include your name and
denote where input is collected, where errors are handled, and where the various list calculations
occur. Hint for stopping input An easy way to capture whether the Enter key was pressed or not
is to initially accept the input as a string, and then convert it to integer, all within a Try block:
try: input_string = input("Enter a Number:") number = int(input_string) If it causes an exception,
in your except clause you can check for either the value of the input_string variable to be an
empty string (which is two double quotes without anything in it) or the length of the string being
zero (the function len can be used). If it's not an empty string but invalid input (like nonnumeric
input) you must continue to seek input after a proper error message.

More Related Content

Similar to The purpose of this assignment is to give you practice with writing lo.docx

Please help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdfPlease help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdf
fsenterprises
 
Answer should be in MIPS please Please ensure you are follo.pdf
Answer should be in MIPS please Please ensure you are follo.pdfAnswer should be in MIPS please Please ensure you are follo.pdf
Answer should be in MIPS please Please ensure you are follo.pdf
sales79
 
22-excel-basics-15511.ppt
22-excel-basics-15511.ppt22-excel-basics-15511.ppt
22-excel-basics-15511.ppt
20ArnavKumar8F
 
Data management( on computer)
Data management( on computer)Data management( on computer)
Data management( on computer)
elvieantony
 
Please find this solution in C++ An OrderedList is a vector that keeps.pdf
Please find this solution in C++ An OrderedList is a vector that keeps.pdfPlease find this solution in C++ An OrderedList is a vector that keeps.pdf
Please find this solution in C++ An OrderedList is a vector that keeps.pdf
aachalsaleswani
 
You are required to open an input file (shown below) then read one c.pdf
You are required to open an input file (shown below) then read one c.pdfYou are required to open an input file (shown below) then read one c.pdf
You are required to open an input file (shown below) then read one c.pdf
arpaqindia
 
Write a complete C programme to implement the following sorting algor.docx
 Write a complete C programme to implement the following sorting algor.docx Write a complete C programme to implement the following sorting algor.docx
Write a complete C programme to implement the following sorting algor.docx
ajoy21
 
Open Office Calc : Level1
 Open Office Calc : Level1 Open Office Calc : Level1
Open Office Calc : Level1
thinkict
 
Instructions Write a program whose main function is merely a.pdf
Instructions Write a program whose main function is merely a.pdfInstructions Write a program whose main function is merely a.pdf
Instructions Write a program whose main function is merely a.pdf
adinathknit
 
Open Office Calc : Level 1
Open Office Calc : Level 1Open Office Calc : Level 1
Open Office Calc : Level 1
thinkict
 
Gui testing
Gui testingGui testing
Gui testing
subbumeyyappan
 
Python workshop
Python workshopPython workshop
Python workshop
Jibin Sabu
 
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdfI am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
RAJATCHUGH12
 
stats
statsstats
stats
Aiden Yeh
 
Calc lessons
Calc lessonsCalc lessons
Calc lessons
Apolinar Fudalan
 
types
typestypes
types
Rajendran
 
Please Please Please Read the instructions and do everything li.docx
Please Please Please Read the instructions and do everything li.docxPlease Please Please Read the instructions and do everything li.docx
Please Please Please Read the instructions and do everything li.docx
tienmixon
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
enidcruz
 
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptxRANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
Out Cast
 
Manual for typing tutor for punjabi raavi font
Manual for typing tutor for punjabi raavi fontManual for typing tutor for punjabi raavi font
Manual for typing tutor for punjabi raavi font
Typing Guru
 

Similar to The purpose of this assignment is to give you practice with writing lo.docx (20)

Please help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdfPlease help. C++ The program is an interactive program th.pdf
Please help. C++ The program is an interactive program th.pdf
 
Answer should be in MIPS please Please ensure you are follo.pdf
Answer should be in MIPS please Please ensure you are follo.pdfAnswer should be in MIPS please Please ensure you are follo.pdf
Answer should be in MIPS please Please ensure you are follo.pdf
 
22-excel-basics-15511.ppt
22-excel-basics-15511.ppt22-excel-basics-15511.ppt
22-excel-basics-15511.ppt
 
Data management( on computer)
Data management( on computer)Data management( on computer)
Data management( on computer)
 
Please find this solution in C++ An OrderedList is a vector that keeps.pdf
Please find this solution in C++ An OrderedList is a vector that keeps.pdfPlease find this solution in C++ An OrderedList is a vector that keeps.pdf
Please find this solution in C++ An OrderedList is a vector that keeps.pdf
 
You are required to open an input file (shown below) then read one c.pdf
You are required to open an input file (shown below) then read one c.pdfYou are required to open an input file (shown below) then read one c.pdf
You are required to open an input file (shown below) then read one c.pdf
 
Write a complete C programme to implement the following sorting algor.docx
 Write a complete C programme to implement the following sorting algor.docx Write a complete C programme to implement the following sorting algor.docx
Write a complete C programme to implement the following sorting algor.docx
 
Open Office Calc : Level1
 Open Office Calc : Level1 Open Office Calc : Level1
Open Office Calc : Level1
 
Instructions Write a program whose main function is merely a.pdf
Instructions Write a program whose main function is merely a.pdfInstructions Write a program whose main function is merely a.pdf
Instructions Write a program whose main function is merely a.pdf
 
Open Office Calc : Level 1
Open Office Calc : Level 1Open Office Calc : Level 1
Open Office Calc : Level 1
 
Gui testing
Gui testingGui testing
Gui testing
 
Python workshop
Python workshopPython workshop
Python workshop
 
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdfI am stuck on parts E and FExercise 1      NumberListTester.java.pdf
I am stuck on parts E and FExercise 1      NumberListTester.java.pdf
 
stats
statsstats
stats
 
Calc lessons
Calc lessonsCalc lessons
Calc lessons
 
types
typestypes
types
 
Please Please Please Read the instructions and do everything li.docx
Please Please Please Read the instructions and do everything li.docxPlease Please Please Read the instructions and do everything li.docx
Please Please Please Read the instructions and do everything li.docx
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
 
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptxRANDOMISATION-NUMERICAL METHODS  FOR ENGINEERING.pptx
RANDOMISATION-NUMERICAL METHODS FOR ENGINEERING.pptx
 
Manual for typing tutor for punjabi raavi font
Manual for typing tutor for punjabi raavi fontManual for typing tutor for punjabi raavi font
Manual for typing tutor for punjabi raavi font
 

More from StephenzcxParsonsq

This question is related to Immunohematology- Rh blood group- There ca.docx
This question is related to Immunohematology- Rh blood group- There ca.docxThis question is related to Immunohematology- Rh blood group- There ca.docx
This question is related to Immunohematology- Rh blood group- There ca.docx
StephenzcxParsonsq
 
These are the results you observe- And once you view the results thi.docx
These are the results you observe-   And once you view the results thi.docxThese are the results you observe-   And once you view the results thi.docx
These are the results you observe- And once you view the results thi.docx
StephenzcxParsonsq
 
There is- a dirty little secret about Alexander Fleming and his discov.docx
There is- a dirty little secret about Alexander Fleming and his discov.docxThere is- a dirty little secret about Alexander Fleming and his discov.docx
There is- a dirty little secret about Alexander Fleming and his discov.docx
StephenzcxParsonsq
 
There is risk involved in consumer decision making as discussed in lec.docx
There is risk involved in consumer decision making as discussed in lec.docxThere is risk involved in consumer decision making as discussed in lec.docx
There is risk involved in consumer decision making as discussed in lec.docx
StephenzcxParsonsq
 
There is a view that life is one big externality- (Just about everythi.docx
There is a view that life is one big externality- (Just about everythi.docxThere is a view that life is one big externality- (Just about everythi.docx
There is a view that life is one big externality- (Just about everythi.docx
StephenzcxParsonsq
 
There is a new test for a new disease- For a specific version of the t.docx
There is a new test for a new disease- For a specific version of the t.docxThere is a new test for a new disease- For a specific version of the t.docx
There is a new test for a new disease- For a specific version of the t.docx
StephenzcxParsonsq
 
There are 100 students in a class- Ninety-six did well in the course w.docx
There are 100 students in a class- Ninety-six did well in the course w.docxThere are 100 students in a class- Ninety-six did well in the course w.docx
There are 100 students in a class- Ninety-six did well in the course w.docx
StephenzcxParsonsq
 
There are a certain number of pigs in a race at the Ohio State Fair th.docx
There are a certain number of pigs in a race at the Ohio State Fair th.docxThere are a certain number of pigs in a race at the Ohio State Fair th.docx
There are a certain number of pigs in a race at the Ohio State Fair th.docx
StephenzcxParsonsq
 
The Wall had protected Westeros from the dangers of the wildlings for.docx
The Wall had protected Westeros from the dangers of the wildlings for.docxThe Wall had protected Westeros from the dangers of the wildlings for.docx
The Wall had protected Westeros from the dangers of the wildlings for.docx
StephenzcxParsonsq
 
The two types of people in an accounting information system are inform.docx
The two types of people in an accounting information system are inform.docxThe two types of people in an accounting information system are inform.docx
The two types of people in an accounting information system are inform.docx
StephenzcxParsonsq
 
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docxThe Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
StephenzcxParsonsq
 
The TATO and FATO ratios calculate how quickly our assets are replaced.docx
The TATO and FATO ratios calculate how quickly our assets are replaced.docxThe TATO and FATO ratios calculate how quickly our assets are replaced.docx
The TATO and FATO ratios calculate how quickly our assets are replaced.docx
StephenzcxParsonsq
 
The third biggest level in Linnaeus' biological classification is- QUE.docx
The third biggest level in Linnaeus' biological classification is- QUE.docxThe third biggest level in Linnaeus' biological classification is- QUE.docx
The third biggest level in Linnaeus' biological classification is- QUE.docx
StephenzcxParsonsq
 
The term haploid refers to a cell in which the chromosomes do not have (1).docx
The term haploid refers to a cell in which the chromosomes do not have (1).docxThe term haploid refers to a cell in which the chromosomes do not have (1).docx
The term haploid refers to a cell in which the chromosomes do not have (1).docx
StephenzcxParsonsq
 
The table below ehes protabilities for various combernations of events.docx
The table below ehes protabilities for various combernations of events.docxThe table below ehes protabilities for various combernations of events.docx
The table below ehes protabilities for various combernations of events.docx
StephenzcxParsonsq
 
The table below shows the values for several different components of G.docx
The table below shows the values for several different components of G.docxThe table below shows the values for several different components of G.docx
The table below shows the values for several different components of G.docx
StephenzcxParsonsq
 
The table below shows the correlations between the death rate from COV.docx
The table below shows the correlations between the death rate from COV.docxThe table below shows the correlations between the death rate from COV.docx
The table below shows the correlations between the death rate from COV.docx
StephenzcxParsonsq
 
The table below describes the distribution of a random sample S of 100.docx
The table below describes the distribution of a random sample S of 100.docxThe table below describes the distribution of a random sample S of 100.docx
The table below describes the distribution of a random sample S of 100.docx
StephenzcxParsonsq
 
The Subtropical Highs are characterized by_________- descending ai.docx
The Subtropical Highs are characterized by_________-     descending ai.docxThe Subtropical Highs are characterized by_________-     descending ai.docx
The Subtropical Highs are characterized by_________- descending ai.docx
StephenzcxParsonsq
 
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docxThe star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
StephenzcxParsonsq
 

More from StephenzcxParsonsq (20)

This question is related to Immunohematology- Rh blood group- There ca.docx
This question is related to Immunohematology- Rh blood group- There ca.docxThis question is related to Immunohematology- Rh blood group- There ca.docx
This question is related to Immunohematology- Rh blood group- There ca.docx
 
These are the results you observe- And once you view the results thi.docx
These are the results you observe-   And once you view the results thi.docxThese are the results you observe-   And once you view the results thi.docx
These are the results you observe- And once you view the results thi.docx
 
There is- a dirty little secret about Alexander Fleming and his discov.docx
There is- a dirty little secret about Alexander Fleming and his discov.docxThere is- a dirty little secret about Alexander Fleming and his discov.docx
There is- a dirty little secret about Alexander Fleming and his discov.docx
 
There is risk involved in consumer decision making as discussed in lec.docx
There is risk involved in consumer decision making as discussed in lec.docxThere is risk involved in consumer decision making as discussed in lec.docx
There is risk involved in consumer decision making as discussed in lec.docx
 
There is a view that life is one big externality- (Just about everythi.docx
There is a view that life is one big externality- (Just about everythi.docxThere is a view that life is one big externality- (Just about everythi.docx
There is a view that life is one big externality- (Just about everythi.docx
 
There is a new test for a new disease- For a specific version of the t.docx
There is a new test for a new disease- For a specific version of the t.docxThere is a new test for a new disease- For a specific version of the t.docx
There is a new test for a new disease- For a specific version of the t.docx
 
There are 100 students in a class- Ninety-six did well in the course w.docx
There are 100 students in a class- Ninety-six did well in the course w.docxThere are 100 students in a class- Ninety-six did well in the course w.docx
There are 100 students in a class- Ninety-six did well in the course w.docx
 
There are a certain number of pigs in a race at the Ohio State Fair th.docx
There are a certain number of pigs in a race at the Ohio State Fair th.docxThere are a certain number of pigs in a race at the Ohio State Fair th.docx
There are a certain number of pigs in a race at the Ohio State Fair th.docx
 
The Wall had protected Westeros from the dangers of the wildlings for.docx
The Wall had protected Westeros from the dangers of the wildlings for.docxThe Wall had protected Westeros from the dangers of the wildlings for.docx
The Wall had protected Westeros from the dangers of the wildlings for.docx
 
The two types of people in an accounting information system are inform.docx
The two types of people in an accounting information system are inform.docxThe two types of people in an accounting information system are inform.docx
The two types of people in an accounting information system are inform.docx
 
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docxThe Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
The Twist Trust has qenerated $60-000 in depreciation deductions for t.docx
 
The TATO and FATO ratios calculate how quickly our assets are replaced.docx
The TATO and FATO ratios calculate how quickly our assets are replaced.docxThe TATO and FATO ratios calculate how quickly our assets are replaced.docx
The TATO and FATO ratios calculate how quickly our assets are replaced.docx
 
The third biggest level in Linnaeus' biological classification is- QUE.docx
The third biggest level in Linnaeus' biological classification is- QUE.docxThe third biggest level in Linnaeus' biological classification is- QUE.docx
The third biggest level in Linnaeus' biological classification is- QUE.docx
 
The term haploid refers to a cell in which the chromosomes do not have (1).docx
The term haploid refers to a cell in which the chromosomes do not have (1).docxThe term haploid refers to a cell in which the chromosomes do not have (1).docx
The term haploid refers to a cell in which the chromosomes do not have (1).docx
 
The table below ehes protabilities for various combernations of events.docx
The table below ehes protabilities for various combernations of events.docxThe table below ehes protabilities for various combernations of events.docx
The table below ehes protabilities for various combernations of events.docx
 
The table below shows the values for several different components of G.docx
The table below shows the values for several different components of G.docxThe table below shows the values for several different components of G.docx
The table below shows the values for several different components of G.docx
 
The table below shows the correlations between the death rate from COV.docx
The table below shows the correlations between the death rate from COV.docxThe table below shows the correlations between the death rate from COV.docx
The table below shows the correlations between the death rate from COV.docx
 
The table below describes the distribution of a random sample S of 100.docx
The table below describes the distribution of a random sample S of 100.docxThe table below describes the distribution of a random sample S of 100.docx
The table below describes the distribution of a random sample S of 100.docx
 
The Subtropical Highs are characterized by_________- descending ai.docx
The Subtropical Highs are characterized by_________-     descending ai.docxThe Subtropical Highs are characterized by_________-     descending ai.docx
The Subtropical Highs are characterized by_________- descending ai.docx
 
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docxThe star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
The star Alpha Lupi (the brightest star in the constellation Lupus) ha.docx
 

Recently uploaded

Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Denish Jangid
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
iammrhaywood
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
RAHUL
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
สมใจ จันสุกสี
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
TechSoup
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 

Recently uploaded (20)

Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Chapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptxChapter wise All Notes of First year Basic Civil Engineering.pptx
Chapter wise All Notes of First year Basic Civil Engineering.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptxNEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
NEWSPAPERS - QUESTION 1 - REVISION POWERPOINT.pptx
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPLAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UP
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
คำศัพท์ คำพื้นฐานการอ่าน ภาษาอังกฤษ ระดับชั้น ม.1
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Walmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdfWalmart Business+ and Spark Good for Nonprofits.pdf
Walmart Business+ and Spark Good for Nonprofits.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 

The purpose of this assignment is to give you practice with writing lo.docx

  • 1. The purpose of this assignment is to give you practice with writing loops and introduce you to lists. Problem Write a program that receives a series of numbers from the user and allows the user to press the Enter key to indicate that inputs are done. As each number is input, it is stored into a list. After the user presses the Enter key (i.e., they enter nothing as input), the program should do the following: - If the list has no elements, just prints "Empty List". - If the list has at least one element, you must print: The total number of items in the list The list itself sorted in ascending order. The sum of all the elements in the list. The average of the elements in the list. The largest value in the list. - The smallest value in the list. - The first half of the list. (If the list has an odd number of elements, you can exclude the middle element. For example, if there are 5 elements, just print the first 2.) Each individual list element. You must use a loop to iterate through the list to print each element, and each element must be separated by a tab character (V). Inputs Any input other than a number or the Enter key should be caught using an exception with an appropriate error message and the program should continue seeking input. Comments Make sure your code is sufficiently commented! In this case, you'll want to include your name and denote where input is collected, where errors are handled, and where the various list calculations occur. Hint for stopping input An easy way to capture whether the Enter key was pressed or not is to initially accept the input as a string, and then convert it to integer, all within a Try block: try: input_string = input("Enter a Number:") number = int(input_string) If it causes an exception, in your except clause you can check for either the value of the input_string variable to be an empty string (which is two double quotes without anything in it) or the length of the string being zero (the function len can be used). If it's not an empty string but invalid input (like nonnumeric input) you must continue to seek input after a proper error message.