Pday1:print,type,int,input,if,elif,else,while,continue

一,print type int 

  print(要打印的东西) type类型  int数字整形

     

二,input

  input是交互式的命令使用格式举例  name = input('请输入你的名字')

三,if,elif,else

  if,elif,else都是条件判断语句。注意:input输入默认是str(字符型)if判断x==100是数字型所以要做数据类型的转换

   

四,while无限循环, break在while中终止循环, contiue在while中终止单次循环

 

 

while 设定条件 循环到count=100

while 循环过程中 被break中断 循环结束

while 循环过程中嵌套if语句 当count > 3 并且 count<98时 进入continue中断单次循环

 

  

猜你喜欢

转载自www.cnblogs.com/nannanzuibang/p/9459385.html
今日推荐