摘要:
""" test1.py 注意缩进!! """ def pt_line(char,times,num): row=0 while row<num: print(char * times) row+=1 name ="my first module:" """ test2.py """ import 阅读全文
摘要:
def pt_line(c,times): #形参 print(c*times) times=5 char="*" row=0 while row<5: pt_line(char,times) # char ,times 实参 row+=1 循环里面的pt_line 执行时,传递参数进入第一行执行, 阅读全文
摘要:
py 根据缩进确定if 或者while 的范围 while 后面不用括号 ,使用分号 默认print 自动回车,如果不需要回车加上 ,end="" 不支持 i++ i=1;j=1 while i<=9: j=i while j<=9: print("%dX%d=%d "%(i,j,i*j),end= 阅读全文