Membership Operators

Code and Output

a = 10
b = 20
list1 = [1, 2, 3, 4, 5 ]

if ( a in list1):
print ("Line 1 - a is available in the given list")
else:
print ("Line 1 - a is not available in the given list")

if ( b not in list1):
print ("Line 2 - b is available in the given list")
else:
print ("Line 2 - b is not available in the given list")

c=b/a
if ( c in list1):
print ("Line 3 - c is available in the given list")
else:
print ("Line 3 - c is not available in the given list")

Comments

Popular posts from this blog

WAN Technology

LO3 - Know the features and functions of information systems

WDD - LO1 - MANAGE SECURE SITES