This quiz aims at testing your basic knowledge of Python’s print function, and the how to string manipulation in Python. Don’t forget to push your answers to your remote repository by the end of quiz time. Push your quiz-5 readme.md file to quiz/5/ folder in your Github project. If you write your answers in Python scripts, put the script files in the same folder as well. If you feel uncertain about your answer, you can test your final codes on Jupyter or IPython command lines.

1.  Make a string from the following list, with one one-line of Python code.

mylist = ['The' , 'weather' , 'is' , 'rainy' , 'today' , 'and' , 'cold' , 'only' , '22' , 'F.']


2.  Are tuples mutable objects? Can they be redefined?

3.  How do you define an empty dictionary?

4.  Write a dictionary representation of the following matrix.

\[\begin{bmatrix} 0 & 0 & 0 & 1 \\ 2 & 0 & 0 & 0 \\ 0 & 5 & 0 & 0 \\ 0 & 0 & 0 & 3 \end{bmatrix}\]




Comments