开发者

Why does Learn Python The Hard Way suggest to "Read your .py file backwards."?

开发者 https://www.devze.com 2023-01-30 17:52 出处:网络
I am reading Learn Python The Hard Way and I 开发者_Go百科am really curious what he means by Read your .py file backwards

I am reading Learn Python The Hard Way and I 开发者_Go百科am really curious what he means by

Read your .py file backwards


Exercise 41 (page 117) explains it better. This snippet:

cities['_find']=find_city
city_found=cities['_find'](cities,state)

reads like this when read backwards:

  1. state and city are...
  2. passed as parameters to...
  3. a function at...
  4. _find inside...
  5. the dict cities...
  6. and finally assigned to city_found.


Reading something backwards word-for-word is also a great proofreading technique.

Often, when reading something forwards, you'll skip past words as you'll be assuming what comes next. Reading something backwards allows you to spot spelling errors more effectively.

0

精彩评论

暂无评论...
验证码 换一张
取 消