Question: PYTHON: Take in 5 int inputs from the user and add them together. The catch is that you can no longer assume that what the

4. Take in 5 int inputs from the user and add them together. The catch is that you can no longer assume that what the user enters is a valid int. If the user enters an invalid input, print an error message and make the user input the int again until all 5 int values are entered correctly. Print the resulting sum. $ python script_4.py Enter int #1: 4 Enter int #2: a Invalid input. Please enter an int. Enter int #2: 6 Enter int #3: 5.5 Invalid input. Please enter an int. Enter int #3: 5 Enter int #4: -8 Enter int #5: -6.3 Invalid input. Please enter an int. Enter int #5: -6 Your sum is 1 1. Write a function that takes in a list data structure as input. The function should create a new list and only include unique elements of the inputted list. Under the function, write code that calls the function with a test list like so and print out the result. Remember that your code should work for all lists of integers, not just the sample test here. my_list = [1, 2, 3, 2, 1, 4] unique_list get_unique_list(my_list) print(unique_list) = $ python script_1.py [1, 2, 3, 4]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
