Dictionary

--Originally published at codemathblog.wordpress.com

A dictionary in python is a key to get a new value from a list of values(the dictionary)

ap

The sintaxys for a dictionary is
new_variable={‘word’:’Hi’)
Then we write the name of the dictionary and what we want to translate:  new_variable[word]

This will print (‘Hi’)

Lets see an example with code!

acv

My function encodes the secret message with the appropiate dictionary
For example, mi first letter is p returns a ‘C’.

The secret message of the code is:
cs

Thanks for reading?

Here you can find a dictionary guide:

https://www.tutorialspoint.com/python/python_dictionary.htm

And a video with examples:

 

References:

S. a.(2016). Data structures. Recovered from: https://docs.python.org/2/tutorial/datastructures.html