Answers for "does set allow duplicates in python"

3

python has duplicates

def has_duplicates(lst):
    return len(lst) != len(set(lst))
    
x = [1,2,3,4,5,5]
has_duplicates(x) 			# True
Posted by: Guest on February-16-2021
0

does tuple allow duplicate values in python

thistuple = ("apple", "banana", "cherry", "apple", "cherry")
print(thistuple)
Posted by: Guest on December-29-2021

Code answers related to "does set allow duplicates in python"

Python Answers by Framework

Browse Popular Code Answers by Language