主要有三种方法:
①在程序行前面加“#”
②将需要注释的代码用'''----''' 包起来,此方法类似C的注释方法
③将需要注释的代码选住然后利用“Ctrl+/”进行注释
# test=input('>>>') # print(test) # l=len(test) # print(l) # r=range(l) # for item in r: # print(item,test[item])
就个人而言,更喜欢第三种方式。
主要有三种方法:
①在程序行前面加“#”
②将需要注释的代码用'''----''' 包起来,此方法类似C的注释方法
③将需要注释的代码选住然后利用“Ctrl+/”进行注释
# test=input('>>>') # print(test) # l=len(test) # print(l) # r=range(l) # for item in r: # print(item,test[item])
就个人而言,更喜欢第三种方式。