直接肝程序吧!

"""
# 作业六:用户登录测试(三次机会) count = 1
while count <= 3:
user = input('请输入用户名: ')
password = input ('请输入密码: ')
if user == 'dachao' and password == '123':
print ('你真厉害!!!')
break
else:
print ('再试一次呦!')
count+=1
""" """
# 作业四:输出1-100内所有的偶数 i = 1
while i <= 100:
if i%2 == 0:
print (i)
i+=1
"""
"""
# 作业三:输出1-100内的所有奇数 i = 1
while i <= 100:
if i%2 != 0:
print (i)
i+=1
""" """
# 作业二:求1-100的所有数的和 i = 1
sum = 0
while i <= 100:
sum = sum + i
i+=1
print (sum) """ """
# 作业一:while 循环输出1 2 3 4 5 6 8 9 10 无7 !!! i = 1
while i <= 10:
if i !=7:
print (i)
# i+=1
# else:
# i+=1
# continue
i+=1
""" """
name = input ('请输入用户名: ')
password = input ('请输入密码: ') if name == 'dachao' and password == '123':
print ('user login successful')
else:
print ('user or code is wrong!') """
"""
#通过tag的True赋值,实现用户名和密码必须为真进行下一步,否则无线循环的目的。
tag = True
while tag :
username = input ('input username: ')
password = input ('input password: ')
if username == 'dachao' and password == '123' :
while tag :
cmd = input ('>>: ')
if cmd == 'q' :
tag = False
continue
print ('------->%s' %cmd) """
"""
#九九乘法表
for i in range(1,10) :
for j in range(1,i+1) :
print ('%d*%d=%d' %(i,j,i*j),end = ' ')
print () #每次执行语句自动占用一行,“/n”代表空一行
""" """
name = input ('请输入用户名: ') if name == 'dachao' :
print ('你最牛逼!')
elif name == 'xiaochao' :
print ('你可以的!')
else:
print ('你还需努力呢!') """ """
while True:
print ('123')
print ("456")
continue """
"""
import getpass
password = getpass.getpass ('请输入密码: ')
print (password)
#自带idle不支持隐藏回显。 """

Python入门

Day 13 Python 一之helloworld的更多相关文章

  1. 13.python笔记之pyyaml模块

    Date:2016-03-25 Title:13.Python笔记之Pyymal模块使用 Tags:Python Category:Python 博客地址:www.liuyao.me 作者:刘耀 YA ...

  2. python 第一课 helloworld

    #!/usr/bin/env python #-*-coding:utf-8-*- #以上是配置编写环境的开始 #第一行env表示运行当前环境变量内的python版本(2.x or 3.x) #第二行 ...

  3. python基础(1)-helloworld

    搭建python运行环境 下载python安装包 配置好环境变量,可参考此链接 第一个helloworld #单行注释 '''多行注释''' """多行注释"& ...

  4. 2019.04.13 python基础

    第一节    主要讲python背景  没什么要注意的  了解记住概念就好 python官网  python.org  自带shell  可以运行python代码 在IDLE中怎么运行代码 新建文本  ...

  5. Python学习:13.Python正则表达式

    一.正则表达式简介 正则表达式是一个特殊的字符序列,它能帮助你方便的检查一个字符串是否与某种模式匹配. Python 自1.5版本起增加了re 模块,它提供 Perl 风格的正则表达式模式. 就其本质 ...

  6. 3.24 7.13 Python基础汇总

    对象类型 类型名称 示例 简要说明 备注 数字 int,float,complex 1234,3.14,1.3e5,3+4j 数字大小没有限制 十六进制用0x前缀和0-9,a-f表示 字符串 str ...

  7. 13.python内置模块之re模块

    什么是正则? 正则表达式也称为正则,是一个特殊的字符序列,能帮助检查一个字符串是否与某种模式匹配.可以用来进行验证:邮箱.手机号.qq号.密码.url = 网站地址.ip等.正则不是python语言独 ...

  8. 13.python中的字典

    字典其实和之前的元祖和列表功能相似,都是用来储存一系列对象的.也就是一种可变容器,或者是我所比喻的革新派的菜单. 但也不是完全相同,我在之前曾经将字典称为特殊的'序列',是字典拥有序列的部分特性,但是 ...

  9. 13 python初学(函数)

    函数: 概念:函数是指将一组语句的集合通过一个名字(函数名)封装起来,要想执行这个函数,只需调用其函数名即可 创建: def 函数名命名规范: a. 必须以下划线或字母开头 b. 区分大小写 c.不能 ...

随机推荐

  1. pb2.text_format.Merge(f.read(), self.solver_param) AttributeError: 'module' object has no attribute 'text_format'

    http://blog.csdn.net/qq_33202928/article/details/72526710

  2. Codeforces Round #273 (Div. 2)-A. Initial Bet

    http://codeforces.com/contest/478/problem/A A. Initial Bet time limit per test 1 second memory limit ...

  3. ueditor1.4.3.all.js报错

    .replace( /<[^>/]+>/g, '' ) 转义符问题! 修改为: .replace( /<[^>\/]+>/g, '' )

  4. common-fileupload上传图片并显示图片

    效果图如下:                                   代码: 注意:需要jar包:commons-fileupload-1.2.1.jar  和 commons-io-1. ...

  5. baidumap demo(三)

    定位 您可以通过以下代码来开启定位功能: 源码复制打印关于 //开启定位功能 [_mapView setShowsUserLocation:YES]; 定位成功后,可以通过mapView.userLo ...

  6. std::ios::sync_with_stdio和tie()——给cin加速

    平时在Leetcode上刷题的时候,总能看到有一些题中最快的代码都有这样一段 static const auto init = []() { std::ios::sync_with_stdio(fal ...

  7. Bzoj 1085: [SCOI2005]骑士精神 (dfs)

    Bzoj 1085: [SCOI2005]骑士精神 题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1085 dfs + 剪枝. 剪枝方法: ...

  8. heartbeat+drdb+nfs实现高可用

    一.环境 nfsserver01:192.168.127.101 心跳:192.168.42.101 centos7.3 nfsserver02:192.168.127.102 心跳:192.168. ...

  9. 关于$test$plusargs和$value$plusargs的小结

    见: http://www.cnblogs.com/nanoty/p/4355245.html

  10. python 中变量和对象

    1. 在 python 中,类型属于对象,变量是没有类型的:a=[1,2,3] a="Runoob"以上代码中,[1,2,3] 是 List 类型,"Runoob&quo ...