#1、使用while循环输入 1 2 3 4 5 6 8 9 10
'''
count = 0
while count < 10:
count += 1 # count = count + 1
if count == 7:
print(' ')
else:
print(count)

count = 0
while count < 10:
count += 1 # count = count + 1
if count == 7:
continue
print(count)
'''
#3、输出 1-100 内的所有奇数
#方法一:
# count = 1
# while count < 101:
# print(count)
# count += 2
#方法二:
# count = 1
# while count < 101:
# if count % 2 == 1:
# print(count)
# count += 1

#5、求1-2+3-4+5 ... 99的所有数的和
# sum = 0
# count = 1
# while count < 100:
# if count % 2 == 0:
# sum = sum - count
# else:
# sum = sum + count
# count += 1
# print(sum)

#6、用户登陆(三次机会重试)
#input 心中有账号,密码 while

i = 0
while i < 3:
username = input('请输入账号:')
password = int(input('请输入密码:'))
if username == '咸鱼哥' and password == 123:
print('登录成功')
else:
print('登录失败请重新登录')
i += 1

day0201的更多相关文章

随机推荐

  1. c语言条件编译#ifdef与#if defined

    c语言条件编译#ifdef与#if defined   c语言条件编译#ifdef与#if defined 摘自:https://www.cnblogs.com/zhangshenghui/p/566 ...

  2. AJAX和DHTML

    DHTML: (动态的html)本身不是一门新语言,而是一门新技术,包含以下 html . css . dom . js AJAX  :  也是一门新技术包含    html . css.  dom ...

  3. HUST软测1504班第6周小组作业成绩

    说明 本次公布的成绩为第6周小组作业的结果: 第6周小组作业:WordCount(详情见毕博平台) 如果同学对作业结果存在异议,可以: 在毕博平台讨论区的第6周作业第在线答疑区发帖申诉. 或直接在博客 ...

  4. smarty内置函数、自定义函数

    1.把字符串里的d字母替换成h格式:{'d'|str_replace:'h':$str}; d要查找的字符 h要替换的字符 $str字符串 2.function test($param){$p1=$p ...

  5. 去除SVN图标并解除svn控制 (转)

    今天一不小心把F盘弄成了SVN管理项目,结果如图: 看到这个,当场晕菜,经过不懈的努力终于找到一种方法,如下: 右键  ===>TortoiseSVN   ===>Settings 点击确 ...

  6. python列表技巧

    1.访问列表元素 test1 = ["chengqian","and","what"] print(test1[0])#第一个元素 prin ...

  7. 一款基于uploadify扩展的多文件上传插件,完全适用于Html5

    http://www.uploadify.com/documentation/  官网里面有两个插件,一个是要使用flash插件才能文件上传的插件,另外一个是不需要使用要flash插件的文件上传插件完 ...

  8. JavaScript - this详解 (二)

    用栗子说this Bug年年有,今年特别多 对于JavaScript这么灵活的语言来说,少了this怎么活! function 函数 this 对于没有实例化的function,我们称之为函数,即没有 ...

  9. PyCharm可用Active Code分享

    目前可用,不保证更新!请及时取用. 6YQUPH9R7H-eyJsaWNlbnNlSWQiOiI2WVFVUEg5UjdIIiwibGljZW5zZWVOYW1lIjoi5o6I5p2D5Luj55C ...

  10. mongoexport遭遇Authentication failed

    今天使用mongoexport工具导出数据,遇到权限不足报错:[host]$mongoexport  -h 10.31.11.190:23820 -udbmgr -pMgr2mgdb -d rcmp ...