List of Unique Tuples
Write a program to print the lists which contain the unique elements in the given list of lists.
Sample Input 1
3
1 2 3
5 10 15
10 20 10 30
Sample output 1
[[1,2,3],[5,10,15]]
n = int(input("Enter number of lines: "))
string = " "
for i in range(0, n):
str1 = input("Enter elements of the line: ")
string += str1 + "\n"
list1 = list(string.split("\n"))
list2 = []
print(list1[0])
for i in list1:
row =set(list(i.split(" ")))
print(row)
Comments
Leave a comment