This my code writtin based the book byte of python.