Python if while continue break语句

Posted 159357zzx

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Python if while continue break语句相关的知识,希望对你有一定的参考价值。

五:执行一个操作

        提醒用户输入用户名和密码

        获取用户名和密码,检测用户名 name ,密码 root

  

 input 输入 input(“>>>”) 字符型

           int(input(“>>>”)) 转换为数字

 

  1. if 条件 :

   Print(“ok”)

   eles :

   Print(“Error”)

  1. if 支持嵌套
  2. if elif

If....

elif ..... :

elif ..... :

elif ..... :

else.... :

 4 .pass

If 1==1:

  Pass

Else:

  Print(“hello”)

 

While 循环

Continue 结束当前循环

break  结束整个循环

以上是关于Python if while continue break语句的主要内容,如果未能解决你的问题,请参考以下文章