Yiyang's Chapter2 Exercise

by Yiyang Shi

18 Jan 2016

This is Exercise 2:

This is Exercise 3:

This is Exercise 5:

Reflection:

First, the float or int function does not change the input’s type. It only displays the input in the specific type. One needs to create a new variable in order to save the input in the specified type.

Second, python can not print strings concatenated with int or float. One needs to change the type of the data into strings to get it printed with strings. Third, when a variable is assigned as the result of some mathematical function, it will be automatically saved as float or int type.

Find Yiyang Shi on Twitter, Github, and on the web.