如何debug
1.设置断点:在Python编辑器中要调试的代码行右击->Set Breakpoint,之后该行底色就变黄了
2.打开debugger:Python Shell->Debug->Debugger
3.在代码编辑窗口按F5或者是在run菜单中选择run model
4.debug过程略
· Go表示运行完,不过按F5后先要Go一下才能往下走,默认是不运行的
· Step表示一步一步
· Over表示跳过函数方法
Out表示跳出本函数
1、先用IDLE中写入完整源码
#*-coding:utf-8 -*-
'''''
figure the surface of cube
'''
class cube:
def __init__(self,l=2,w=3,h=4):
self. l=l
self.w=w
self. h=h
def surface(self):
result=( self.l* self.w+ self.l* self.h+ self.w* self