Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this code, not sure how to do it Write a program that inputs .3 list of integers from the user, and removes

Need help with this code, not sure how to do it

image text in transcribedimage text in transcribed
Write a program that inputs .3 list of integers from the user, and removes the duplicate list elements, plus outputs their min and max values. Here is some sample output: Your program should stop the input if anything other than a positive integer is entered. You may want to use the "isdecimal" function andr'or others described in Mython docs for string methods. 9 (1 Point] Your program should have at least 2 functions. including a maini) function [no global variables or global code other than a call to main within an ifustatementi {1.5 Points for each function} If at least one positive integer is entered, your program should output the smallest {minimum} and largest {maximum} values in the list. {1 Point] When the program is nished. the program must have a list that stores each number only once {without duplicates}, in the same order they were entered. So you can't just skip outputting the duplicatES - you have to remove them [or replace them} [1 Point] The easiest and most efcient way to do this is to store only the non-repeating elements (only store a number in the array the rst time you see it}. You can use the "in" or "not in" boolean operators described in section 10.5 of ym book. e (1 Point] A more intuitive and more complicated way to do it is to input all the numbers from the user into a list, and then change the list so it contains only the distinct numbers entered by the user. To remove the duplicates, you should make it appear as if the elements hadn't been there. So do not just set duplicates to an "empty" value, but delete them [you can use the del statement described in section 10.9 of your book 2 l {1 Point} Every function {except main} needs to have a comment in a triple-quoted string at the beginning, briefly explaining what it does. [1 Point]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Dental Assisting

Authors: Doni Bird, Debbie Robinson

13th Edition

978-0323624855, 0323624855

Students also viewed these Programming questions

Question

Why is it important to study the small business failure rate?

Answered: 1 week ago