So I wrote this code to return back every string in the given lst: list once. Here is my code
def make_unique(lst: list):
s =
for x in... moreSo I wrote this code to return back every string in the given lst: list once. Here is my code
def make_unique(lst: list):
s =
for x in lst:
if lst.count(x) == 1:
s.append(x)
else:
return(x)
return s
When I put in the input:
print(make_unique(lst=))
The output returns
row
but I want my output to return
which is basically all the strings in the list printed once. How can I do this??
In Python, Suppose there is a dictionary named... moreIn Python, Suppose there is a dictionary named fruits:
fruits={
"apple":5,
"orange":7,
"mango":9
}
On reading the dictionary items, it should create 3 lists having same name as dictionary keys viz. apple, orange and mango and size of theses lists should be 5, 7 and 9 respectively. The elements of these lists should be given from the user through console.