Skip to content

Instantly share code, notes, and snippets.

@Raj39120
Created May 2, 2020 22:55
Show Gist options
  • Save Raj39120/53e347d2e47c54b8aeeb5d338b283742 to your computer and use it in GitHub Desktop.
Save Raj39120/53e347d2e47c54b8aeeb5d338b283742 to your computer and use it in GitHub Desktop.
def loop_and_constructing_list_solution():
user_input = input("Enter a list of numbers separated by a comma (x, y, z) over here: ")
my_list = []
for i in user_input:
if i in my_list:
continue
my_list.append(i)
print my_list
loop_and_constructing_list_solution()
def set_solution():
user_input = input("Enter a set of numbers separated by a comma (x, y, z) over here: ")
my_set = set()
for i in user_input:
my_set.add(i)
print my_set
set_solution()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment