Answer:
The program in python is as follows:
original = []
inp = int(input(": "))
while inp>=0:
if inp<=2000000000:
original.append(inp)
inp = int(input(": "))
newlist = []
for i in original:
if i not in newlist:
newlist.append(i)
newlist.sort()
for i in newlist:
print(i)
Step-by-step explanation:
This initializes the original list
original = []
This gets input for the list
inp = int(input(": "))
The following loop is repeated while input is not negative
while inp>=0:
This ensures that only inputs from 0 and 2000000000 enters the list
if inp<=2000000000:
original.append(inp)
Prompt the user for another input
inp = int(input(": "))
This initializes a newlist
newlist = []
Iterates through the original list
for i in original:
Check for duplicate
if i not in newlist:
Each number is entered to the new list, without duplicate
newlist.append(i)
This sorts the new list in ascending order
newlist.sort()
This prints the list item one per line
for i in newlist:
print(i)