Question: Write a program to get a first integer input from the user, use while to get the next input and determine if the current input
Write a program to get a first integer input from the user, use while to get the next input and determine if the current input integer is the same with the previous input. If adjacent values are the same, output a message stating they are duplicate inputs. Process data until the sentinel -1 is entered.
For example: A program run:
Enter a value: 5
Enter a value: 3
Enter a value: 5
Enter a value: 5
--Duplicate input!
Enter a value: 8
Enter a value: -1
Program in python please using while loop.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
