comparing list elements.
x=['abc','bcd','cde']
y=['abc','bcd','cde']
z=['ABC','BCD','CDE']
print(x==y)
print(x==z)
print(x!=z)
output:
True
False
True
example 2:
x=['abc','bcd','cde']
y=['abc','bcd','cde']
z=['ABC','BCD','CDE']
print(x[0] is y[0])
print(x==z)
print(x!=z)
output:
True
False
True
No comments:
Post a Comment