#_*_coding:utf-8_*_
#作者:王佃元
#日期:2019/12/6 #格式化输出
name = input("Name")
age = input("Age")
job = input("Job")
salary = input("Salary")
msg = '''
------------ info of %s------------
Name : %s
Age : %s
Job : %s
Salary :%s
-------------- end ----------------
'''%(name,name,age,job,salary)
print(msg)
'''
如何让上述内容按照既定的格式输出?
------------ info of drey------------
Name : dery
Age : 35
Job : it
Salary : 3000
-------------- end ----------------
name,name,age,job,salary
python中使用%s
'''
#_*_coding:utf-8_*_
#作者:王佃元
#日期:2019/12/6
#用户登录程序
#for循环的用法:for i in range(a,b,c)
#a,b,b分别为:a表示起始值、b表示结束值、c表示步长
# _user_ = "dery"
# _password = "abc"
# passed_check = False
# for i in range(3):
# username = input("username:")
# password = input("password:")
# if username == _user_ and password == _password :
# print("welcome is login .....")
# passed_check = True
# break
# else:
# print("Invalid username or password")
# if not passed_check:
# print("要不要脸,臭流氓!") _user_ = "dery"
_password = "abc"
for i in range(3):
username = input("username:")
password = input("password:")
if username == _user_ and password == _password :
print("welcome is login .....")
break
else:
print("Invalid username or password")
else:
print("要不要脸,臭流氓!")
# for i in range(101):
# if i%2 == 0
# print(i)
#
# for i in range(100):
# if i > 70 or i < 50:
# print(i)

pycharm初识及格式化输出的更多相关文章

  1. 19-3-1Python的PyCharm编辑器,以及格式化输出、while循环、运算符、编码初识

    第一次使用PyCharm,需要注意到是否使用的自己安装的python版本,或者使用的自带版本,如果使用的自带版本,注意切换. PyCharm使用优点,可以一步一步看程序的出错问题,即Debug的使用, ...

  2. python_format格式化输出、while else、逻辑运算符、编码初识

    1.格式化输出 .%d  %s  格式化输出:% 占位符,d 表示替换整型数,s表示要替换字符串. name = input('请输入名字:') age = input('请输入年龄:') sex = ...

  3. while循环、格式化输出、运算符和编码初识

    while循环 1. while循环的结构 while 条件: 执行语句1 执行语句2 i = 0 while i < 10: print(i) i += 1 运行结果 0 1 2 3 4 5 ...

  4. python -- while循环,格式化输出,运算符,初识编码

    一.while循环 1.语法 while   条件: 循环体(结果) 如果条件为真,则直接执行结果),然后再次判断条件,知道条件为假,停止循环. while True: print('你是谁呢') 退 ...

  5. while循环 格式化输出 密码本 编码的初识

    第二天课程整理 while 循环 why : while ' 循环' 的意思 what : while 无限循环 how : 1.基本结构 while + 条件 循环的代码 初识循环 while tr ...

  6. 第四天,for循环,格式化输出,占位符,pycharm安装.列表处理

    字符格式化输出 占位符 %s s = string %d d = digit 整数 %f f = float 浮点数,约等于小数 列表,元组 查 索引(下标) ,都是从0开始 切片 .count 查某 ...

  7. while 格式化输出 编码初识

    1.while循环 while 关键字 空格 条件 冒号 缩进 循环体 while 3>2: print("好嗨呦") print("你的骆驼") pri ...

  8. 记录我的 python 学习历程-Day02-while 循环/格式化输出/运算符/编码的初识

    一.流程控制之--while 循环 循环就是重复做同一件事,它可以终止当前循环,也可以跳出这一次循环,继续下一次循环. 基本结构(基本循环) while 条件: 循环体 示例 # 这是一个模拟音乐循环 ...

  9. while循环,格式化输出,运算符及编码初识

    一.while循环 1.基本循环(死循环) while 条件: 循环体 2.使用while计数 count = 0 # 数字里面非零的都为True while True: count = count ...

随机推荐

  1. gulp的初阶使用方法(转)

    安装好gulp之后接下来就是使用了,此文主要介绍一些前端开发时常用的一些插件及其用法 http://www.imooc.com/article/tag/26/hot/12插件安装 安装本地服务器插件: ...

  2. 大话设计模式Python实现-策略模式

    策略模式(Strategy Pattern):它定义了算法家族,分别封装起来,让他们之间可以相互替换,此模式让算法的变化,不会影响到使用算法的客户. 下面是一个商场活动的实现 #!/usr/bin/e ...

  3. 算法(贪心|BF|KMP)

    贪心算法 前置知识 const Greedy = num => { //贪心 let arr = [100, 20, 10, 5, 2, 1] let count = 0; for (let i ...

  4. linux下c++如何输入不回显

    #include <stdio.h> #include <termios.h> #include <unistd.h> #include <iostream& ...

  5. 解决 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:reyo' did not find a matching property.

    解决办法是:关闭tomcat,双击eclipse下tomcat服务器,在出来的Tomcat server at localhost页面中找到server options选项,选中其中的选项”Publi ...

  6. 关于 AutoResetEvent 的介绍的简单示例

    关于 AutoResetEvent 的介绍的简单示例 直接贴代码了: class Program { static void Main(string[] args) { string result = ...

  7. Blend 设置一个圆形的按钮

    原文:Blend 设置一个圆形的按钮 1)画一个圆形 右击构成控件 3)选择button  当然如果想做成别的控件 都可以 4)我们有了一个button 5)做动画 6)定义触发器 7)定义事件 效果

  8. JS提交表单页面不跳转、JS下载、动态创建from

    JS下载 function downloadFile(id) {     var url =  "<%=request.getContextPath()%>/cer/downlo ...

  9. 03 .NET CORE 2.2 使用OCELOT -- Docker中的Consul

    部署consul-docker镜像 先搜索consul的docker镜像 docker search consul 然后选择了第一个,也就是官方镜像 下载镜像 docker pull consul 然 ...

  10. SpringBoot项目解决全局响应返回中文乱码问题

    一.问题 新建的基于SpringBoot的MVC项目,在请响应体中,如果有中文,会显示为乱码. 二.解决方案 1.在application.properties中设置: spring.http.enc ...