Created
May 2, 2020 22:55
-
-
Save Raj39120/53e347d2e47c54b8aeeb5d338b283742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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