Creation and use of dictionaries in Python

--Originally published at Py(t)hon

This is the last post of the mastery topics, so let’s give everything to it. Dictionaries, they are just another type of data just like lists and tuples. They are indexed by keys, which can be any immutable type, or tuples if they don’t contain any mutable object.

You can create them with: {}, there is also a function dict() inside you put all the elements that you want inside the dictionary.Here is an example of a dictionary:

tel = {'jack': 4098, 'sape': 4139}

Here is a cool video:

That’s all of the semester, i have completed my mastery topics #PUG#Tec#TC101#TheEnd#Dictionaries

 


Creation and use of strings

--Originally published at Py(t)hon

This is very easy to learn, first to create a string what you should do is enclose all the characters between quotes like this Ex: str1= “Hello”, this is a string already.

You can play with the string and updated, change it, add more, print it completely, print it partially etc.

str1

Here is a video of strings:

That’s all #Pug#Tec#TC101#Strings#TheEnd