解决莫名其妙的问题bug的方法
2019-04-13 本文已影响21人
AOS加贝
就是一开始就别让问题存在
我是一名c++、Java连续挂科的python初学者,25天的python自学,一直对“莫名其妙的bug”而苦恼。一是我有时候解决不了它,二是对我的编程学习没有多大帮助却耗费了我大量注意力。
那怎么才能一开始就让问题不存在呢?
- 意识到面对莫名其妙的bug问题,本质上的问题是耗费了过多时间、精力!
- 记住易错点,例如必须用英文符号
- 辨别‘问题’的性质,值得解决还是不值得解决
- 值得解决,那就规定好死磕的时间,有效率地解决。规定时间到了,就不再纠结,先完成当天的学习目标
- 不值得解决,那就继续学python,先完成当天的学习目标
#怎么才能一开始就让问题不存在
import time
print('Remember the wrong points, for example, you must use the English symbol')
errorvalue=input('please input errorvalue:worth or worthless:')
if errorvalue=="worth":
print('Specify the time for research ')
researchtime=int(input('please input the time you will spent(mins)'))
time.sleep(researchtime*60)
print('time is up! let\'s continue to learn python')
else:
print('this is a worthless problem,let\'s continue to learn python')