python while循环

while 条件:

        break     #中断循环

        continue  #跳过当次循环,执行下次循环

else:                         #除非异常中断,例如break,否则while循环结束后都会执行else

      print(“hello”)  

 

 

print("hello world.",end="__")    #end 定义结尾符  #换行符 \n     \r\n     \r

print("hello world.",end="__")    #end 定义结尾符

hello world.__hello world.__

 

print()    #输出默认的换行符。等价于 print(end="\n")

举例:

输出九九乘法表

 

 

 

 

 

 

 

 

 

 

posted @ 2020-08-06 21:09  密语笔记  阅读(81)  评论(1)    收藏  举报