<jupyter_start><jupyter_text><jupyter_code>List
workshop = ["Moringa", "School", "Ngong-Lane", "Learning"]
print(workshop)
workshop[0]
workshop[0:2]
workshop.append('People')
print(workshop)
workshop.remove('Moringa')
print(workshop)


age = (100, 200, 300)
type(age)<jupyter_output><empty_output><jupyter_text><jupyter_code><jupyter_output><empty_output><jupyter_text>Dict: Has keys and values<jupyter_code>contact = {"name":"Elly",
           "phone":"0700501255",
           "email":"<EMAIL>"}

print(contact)<jupyter_output>{'name': 'Elly', 'phone': '0700501255', 'email': '<EMAIL>'}<jupyter_text>Using the "get" function<jupyter_code>contact.get('email')<jupyter_output><empty_output><jupyter_text>Using the del function in dict(cant be used in List) syntax is del followed by var name and then the key or value<jupyter_code>print(contact)<jupyter_output>{'name': 'Elly', 'phone': '0700501255', 'email': '<EMAIL>'}<jupyter_text>Set: eliminating duplicate<jupyter_code>num = [12,14, 14, 15, 16, 17, 22]
new_num = set(num)
print(new_num)<jupyter_output><empty_output><jupyter_text>Create a dict with keys:  1 -5          and values:^2 of the keys<jupyter_code>power_dict ={"1":1,"2": 4, 
             "3": 9,
             "4": 16,
             "5": 25}
print(power_dict)
power_dict["5"] = 5**5
print(power_dict)<jupyter_output>{'1': 1, '2': 4, '3': 9, '4': 16, '5': 25}
{'1': 1, '2': 4, '3': 9, '4': 16, '5': 3125}<jupyter_text>Modules: Pre-written code that are imported to perfom certain functionsTo acces any function in a module, yiu call the module plus the function to perform<jupyter_code>import math
number = 100
sqr = math.sqrt(100)
#print(sqr)
squares = {1:(int(math.pow(1,2))),2:(int(math.pow(2,2))),3:(int(math.pow(3,2))),4:(int(math.pow(4,2))),5:(int(math.pow(5,2)))}
print(squares)<jupyter_output>{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
StarcoderdataJupyterStructuredCleanDedup