1great course, highly recommended !
2
3"https://www.udemy.com/course/algorithms-and-data-structures-in-python/"
1# to add key-value pairs to a dictionary:
2
3d1 = {
4 "1" : 1,
5 "2" : 2,
6 "3" : 3
7} # Define the dictionary
8
9d1["4"] = 4 # Add key-value pair "4" is key and 4 is value
10
11print(d1) # will return updated dictionary
1#string
2string = 'Hi my name is Dr.Hippo'
3#integer(whole number)
4integer = 12345
5#floating point number
6fl = 123.456
7#list
8li = [1,2,3,,'string',None]
9#boolean
10t = True
11f = False
12#none(equivalent to null or undefined in other languages)
13n = None
14#dictionary
15dictionary = {'key':'value'}
1list = [same as array with different features]
2array = [23, 'arrayItem', True, ['Hi', 34, False] ]
3dictionary = {'key' : 'value'}
4object = class testObj:
5tuple = ( "a", "b", "c", "d" ); #same as list but non-changable