#1、使用while循环输出1 2 3 4 5 6     8 9 10
# s=0
# while s<10:
# s+=1
# if s==7:
# continue
# print(s)
# for i in range(1,11):
# if i==7:
# continue
# print(i)
# i += 1 #2、求1-100的所有数的和
# s=0
# i=0
# while i<100:
# i+=1
# s+=i
# print(s)
# s=0
# for i in range(1,101):
# s+=i
# print(s) #3、输出 1-100 内的所有奇数
# s=0
# while s<100:
# s+=1
# if s%2==1:
# print(s)
# for i in range(1,101):
# if i%2==1:
# print(i) #4、输出 1-100 内的所有偶数
# s=0
# while s<100:
# s+=1
# if s%2==0:
# print(s)
# for i in range(1,101):
# if i%2==0:
# print(i) #5、求1-2+3-4+5 ... 99的所有数的和
# s=0
# i=1
# while i<100:
# if i%2==1:
# s+=i
# elif i%2==0:
# s-=i
# i+=1
# print(s)
# s=0
# for i in range(1,100):
# if i%2==1:
# s+=i
# elif i%2==0:
# s-=i
# print(s) #6、用户登陆(三次机会重试)
# count=0
# while count<3:
# name=input('请输入用户名 ')
# passwd=input('请输入密码 ')
# if name=='z' and passwd=='123':
# print('登录成功')
# break
# else:
# print('用户名密码错误')
# count+=1 # 改进版
# user='z'
# pwd='123'
# count=0
# while count<3:
# username=input('请输入用户名 ')
# if username == user:
# passwd=input('请输入密码 ')
# if passwd==pwd:
# print('登陆成功')
# break
# else:
# print('密码错误,请重新输入')
# continue
# else:
# count += 1
# print('用户名错误,请重新输入')
# else:
# print('您输错了3次,已锁定')

最新文章

  1. form input file 图片上传360IE兼容问题
  2. DELPHI 读取csv 格式文本文件
  3. Objective-C(内存管理)
  4. [转]oracle pump expdp impdp使用
  5. [转]OOPC:Object-Oriented Programming in C
  6. php excel (转)
  7. 【转】1.5 起步 - 初次运行 Git 前的配置
  8. eclipse安装Flash Builder 4后变成中文,怎么解决
  9. 安装 node-sass 时报错
  10. zoj3211dream city dp 斜率
  11. HanLP Analysis for Elasticsearch
  12. ERROR 1044 (42000): Access denied for user 'root'@'localhost'
  13. php常用扩展安装
  14. 把你的Centos设置成代理ip服务器
  15. Jordan 块的几何
  16. 带列表写入文件出错先 json.dumps
  17. VMware设置inter共享连接出现空值
  18. Centos crontab定时任务
  19. 开启otl的64位长整数支持
  20. 017PHP基础知识——流程控制语句(五)

热门文章

  1. [Android] Ubuntu下Eclipse || Android Studio识别不了手机的官方解决方案
  2. TCP编程,Socket通讯
  3. Muller’s method (website)
  4. 【BZOJ】1596: [Usaco2008 Jan]电话网络(树形dp+特殊的技巧)
  5. js用计时器加载大量dom
  6. ORB特征提取与匹配
  7. Lenna图-莱娜&#183;瑟德贝里
  8. 图像增强:直方图均衡和小波变换【matlab】
  9. GIT 回退出错 Unlink of file &#39;xx&#39; failed. Should I try again? (y/n) 解决办法
  10. springMVC的url-pattern /和/*的区别