Thursday, 2 February 2017

Python Tutorial - 19 (Sets)



Codes and terminologies -
Here we talked about SET

A set is a collection of items

EX-

computer = {'RAM', 'motherboard', 'CDdrive', 'SMPS'}

Code -

computer = {'RAM', 'motherboard', 'CDdrive', 'SMPS'}

print (computer)

if 'RAM' in computer:
   print ("we have RAM")

else:
   print ("We do not have RAM")

For more info please watch the tutorial





other posts -

















No comments:

Post a Comment