membership operators
#membership operator
a = 10
b = 20
list1 = [1, 2, 3, 4, 5]
fi ( a in list1) :
print ("line 1 - a is availabe in the givent list")
else:
print ("line 1 - a is not available in the given list")
if ( b not in list1):
print ("line 2 - b is not availabe in the givent list")
else:
print ("line 2 - b is available in the given list")
c= b/a
if (c in list 1) :
print ("line 3 - b is availabe in the givent list")
else:
print ("line 3 - b is not available in the given list
a = 10
b = 20
list1 = [1, 2, 3, 4, 5]
fi ( a in list1) :
print ("line 1 - a is availabe in the givent list")
else:
print ("line 1 - a is not available in the given list")
if ( b not in list1):
print ("line 2 - b is not availabe in the givent list")
else:
print ("line 2 - b is available in the given list")
c= b/a
if (c in list 1) :
print ("line 3 - b is availabe in the givent list")
else:
print ("line 3 - b is not available in the given list
#membership operator
a = 10
b = 20
list1 = [1, 2, 3, 4, 5]
if ( a in list1) :
print ("line 1 - a is availabe in the givent list")
else:
print ("line 1 - a is not availabe in the givent list")
if ( b not in list1) :
print ("line 2 - b is not availabe in the givent list")
else:
print ("line 2 - b is availabe in the givent list")
c= b/a
if (c in list1) :
print ("line 3 - b is availabe in the givent list")
else:
print ("line 3 - b is not available in the given list")
Comments
Post a Comment