01 of lenrning python
我也打算开始写博客啦!记录一下自己的学习过程~
01密文登陆
这个在vscode中不显示密文

在cmd中看不到密码

 # -*- coding: utf-8 -*-
 import getpass
 name = input("please input your name:")
 password = getpass.getpass('please put in your password:')
 if name == "xb" and password == "":
     print("welcome!")
 else:
         print("you have put in the wrong information!")
 print(name, password)
02各种变量的空值
| 
 数值  | 
 digital = 0  | 
| 
 字符串  | 
 str = "" 或 str = ”  | 
| 
 列表  | 
 list = []  | 
| 
 字典  | 
 ditc = {}  | 
| 
 元组  | 
 tuple= ()  | 
03占位符
(1)%
tpl = "i am %s" % "alex"
tpl = "i am %s age %d" % ("alex", 18)
tpl = "i am %(name)s age %(age)d" % {"name": "alex", "age": 18}
tpl = "percent %.2f" % 99.97623
tpl = "i am %(pp).2f" % {"pp": 123.425556, }
tpl = "i am %.2f %%" % {"pp": 123.425556, }
tpl = "i am {}, age {}, {}".format("seven", 18, 'alex')
tpl = "i am {}, age {}, {}".format(*["seven", 18, 'alex'])
tpl = "i am {0}, age {1}, really {0}".format("seven", 18)
tpl = "i am {0}, age {1}, really {0}".format(*["seven", 18])
tpl = "i am {name}, age {age}, really {name}".format(name="seven", age=18)
tpl = "i am {name}, age {age}, really {name}".format(**{"name": "seven", "age": 18})
tpl = "i am {0[0]}, age {0[1]}, really {0[2]}".format([1, 2, 3], [11, 22, 33])
tpl = "i am {:s}, age {:d}, money {:f}".format("seven", 18, 88888.1)
tpl = "i am {:s}, age {:d}".format(*["seven", 18])
tpl = "i am {name:s}, age {age:d}".format(name="seven", age=18)
tpl = "i am {name:s}, age {age:d}".format(**{"name": "seven", "age": 18})
tpl = "numbers: {:b},{:o},{:d},{:x},{:X}, {:%}".format(15, 15, 15, 15, 15, 15.87623, 2)
tpl = "numbers: {:b},{:o},{:d},{:x},{:X}, {:%}".format(15, 15, 15, 15, 15, 15.87623, 2)
tpl = "numbers: {0:b},{0:o},{0:d},{0:x},{0:X}, {0:%}".format(15)
tpl = "numbers: {num:b},{num:o},{num:d},{num:x},{num:X}, {num:%}".format(num=15)
04登陆交互程序
 # -*- coding: utf-8 -*-
 print("----------welcome---------")
 i = 0
 LockedName = ""
 name = ""
 while i < 3:
     name = input("please input your name:")
     password = input('please put in your password:')
     if name == LockedName:
             print("You have been locked")
     if name == "xb" and password == "":
         print("-----------------")
         print("welcome!")
         print("name:%s,\npassword:%s" % (name, password))
         exit()
     else:
         print("try again")
     if i == 2:
         LockedName = name
         print("your account has been locked!!!")
     i = i + 1
01 of lenrning python的更多相关文章
- python学习笔记01:安装python
		
下载python: 从从https://www.python.org/downloads/下载python,根据操作系统的不同,选择不同的版本下载.注意:linux系统大多预装了python,可以直接 ...
 - Python之行-01之初识python
		
本文介绍 1.python由来与发展2.编程语言排行榜3.python环境安装4.python变量的使用5.python的注释6.用户交互输入7.python的数据类型8.python的运算符9.py ...
 - PyCharm 中文教程 01:运行 Python 的四种方式
		
<PyCharm 中文指南>在线阅读: http://pycharm.iswbm.com/ Github 项目主页: https://github.com/iswbm/pych... 1. ...
 - Python数学建模-01.新手必读
		
Python 完全可以满足数学建模的需要. Python 是数学建模的最佳选择之一,而且在其它工作中也无所不能. 『Python 数学建模 @ Youcans』带你从数模小白成为国赛达人. 1. 数学 ...
 - Python小白的数学建模课-05.0-1规划
		
0-1 规划不仅是数模竞赛中的常见题型,也具有重要的现实意义. 双十一促销中网购平台要求二选一,就是互斥的决策问题,可以用 0-1规划建模. 小白学习 0-1 规划,首先要学会识别 0-1规划,学习将 ...
 - python学习笔记(python简史)
		
一.python介绍 python的创始人为吉多·范罗苏姆(Guido van Rossum) 目前python主要应用领域: ·云计算 ·WEB开发 ·科学运算.人工智能 ·系统运维 ·金融:量化交 ...
 - python教程与资料
		
网上有个人写的python快速教程,非常好.比看书好多了.猛击下面的链接地址 http://www.douban.com/group/topic/30008503/ python文档资料收集 pyth ...
 - 【Python大系】Python快速教程
		
感谢原作者:Vamei 出处:http://www.cnblogs.com/vamei 怎么能快速地掌握Python?这是和朋友闲聊时谈起的问题. Python包含的内容很多,加上各种标准库.拓展库, ...
 - 推荐一些python  Beautiful Soup学习网址
		
前言:这几天忙着写分析报告,实在没精力去研究django,虽然抽时间去看了几遍中文文档,还是等实际实践后写几篇操作文章吧! 正文:以下是本人前段时间学习bs4库找的一些网址,在学习的可以参考下,有点多 ...
 
随机推荐
- Android辅助开发工具合集
			
https://github.com/389273716/android-skill-summary/blob/master/开发工具使用指南/辅助开发工具.md
 - 我的mac下有关php扩展的安装
			
之前安装yaf和mcrypt扩展一直失败,今天终于找到原因了.那是因为./configure的时候没有指定php版本,所以用了默认的php的版本,正确的姿势应该是:./configure --with ...
 - swift 粒子效果
			
1. override func viewDidLoad() { super.viewDidLoad() let rect = CGRect(x: 0.0, y: -70.0, width: view ...
 - 项目中的Launch_getSecurityEntitle_postlaunch
			
研究透彻这个launch和postlaunch的执行过程才能改进他: //AppVTTicket.js ,launch:function(){ Ticketing.inciTick={}; this. ...
 - C#多线程--信号量(Semaphore)[z]
			
百度百科:Semaphore,是负责协调各个线程, 以保证它们能够正确.合理的使用公共资源.也是操作系统中用于控制进程同步互斥的量. Semaphore常用的方法有两个WaitOne()和Releas ...
 - 微信小程序登录流程
			
小程序登录流程 参考 app.js需要做的 1,首先通过wx.login()拿到code,成功之后,发送数据,请求接口,把code发送给后端,换区openid,sessionKey,unionId,把 ...
 - 路飞ORM练习
			
# a.查看所有学位课并打印学位课名称以及授课老师 # degree_list = DegreeCourse.objects.all().values('name', 'teachers__name' ...
 - Failed to create agent because it is not close enough to the NavMesh
			
主要原因是:两个相同对象navmesh点太近造成. 解决方案:通过NavMesh.SamplePosition 获得可以行走点 ;i<;i++) { , mRadius); , 3.14f); ...
 - How to change system keyboard keymap layout on CentOS 7 Linux
			
The easiest way to swap between keymaps and thus temporarily set keys to different language by use o ...
 - Git merge 不同的branch
			
Git的优势是可以创建不同的branch,然后在每个branch上开发.那么问题是:如果不同的branch之间需要做同步,比如sourceBranch上做的修改也需要同步到targetBranch,改 ...