Lab #9: Advanced Topics in Python

 

Today we did some advance methods in python and there are a few to point out.

It is possible to create a list of the keys and values in the dictionaries into tuples of two inside a table. Some possible uses for the returned values are to iterate each pair without having to use the dictionary itself in a for loop.Capture

List can be generated by one line of code using forĀ methods and conditional instead of manually typing out the whole list, especially if the list is going to be long.Capture1

Slices can also be used with steps, meaning that the returning value can hold strings with every other letter in a section other than every letter, or read it in reverse.Capture2

Lambda with lists or strings can be used inside a filter function to filter out the needed result, in this case a hidden message.Capture3