---
author: izayak
title: "Ruotong's Chapter 7 Files Exercises"
layout: post
---

<iframe src="https://trinket.io/embed/python/053fad98d9" width="100%" height="600" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>

  
**Reflection**  
At first I thought there was more than one floating number in each line of mbox-short.txt starting with 'X-DSPAM-Confidence:'. So I wrongly used the for loop and isintance() function. After I found the total variable would remain 0 and the line with isinstance() is correct, I printed items in the for loop and realized for loop should not be used there as it would give me individual characters and digits. Then I printed the line in the file and then converted it into a list with two components. The print is always helpful.  
Practice can help me find out that I am not really get some of the concepts. When I was working on the game app I realized that there were some unclear points in the previous chapters, I reread chapter 8 again and found the traversing part and converting between strings and lists very helpful.

Create Ruotong's Ch7 Exercise Post
Create Ruotong's Ch7 Exercise Post