python简单脚本1
来源:互联网 发布:最好用的p2p软件 编辑:程序博客网 时间:2024/06/05 21:02
Q1. 用户登陆v1:
1). 假设系统中的用户名"root",密码为"westos";2). 如果用户输入用户名和密码均正确显示"login ok" 如果用户名错误,显示"user is not exist" 如果密码错误,显示"password is no ok"3). 只有三次登陆机会,超过三次,显示"count is bigger than 3"
#!/usr/bin/env python#!conding=utf-8username="root"password="westos"for LoginTime in range(1,5): if LoginTime==4: print "count is bigger than 3!" break InName=raw_input("please input username:") InPass=raw_input("please input password:") if InName!=username: print "user is not exist!" elif InPass!=password: print "passwd is not ok!!" else: print "login ok" break
测试结果:
Q2. 编写乘法表;
#!/usr/bin/env python#!conding=utf-8for i in range(1,10): for j in range(1,10): print i,"*",j,"=",i*j," ", if j==i: break print "\n"
测试结果:
阅读全文
0 0
- python简单脚本1
- python简单脚本2
- Python 简单数据备份脚本
- 简单的Python脚本实践
- caffe的简单python脚本
- [python脚本]一个简单的web爬虫(1)
- 用Py2exe打包Python脚本简单介绍
- python 脚本性能查看简单方式
- Python:Maya2WRL简单导出脚本(source included)
- 一个简单的脚本程序----Python
- python nagios简单监控进程数脚本
- 一个简单的python读写文件脚本
- 简单验证码识别的python脚本
- Python:简单的文件备份脚本
- C#调用Python脚本的简单示例
- Python 3.4 简单的抓图脚本
- python 脚本性能查看简单方式
- 简单的python http接口自动化脚本
- Vue之过度(动画)
- 【C语言】【unix c】GDB调试工具的使用
- [CEOI2011] balloons 单调栈
- 嵌套评论的数据库表设计
- php和数据库mysql的一些简单交互
- python简单脚本1
- Centos目录及其常用处理命令
- 欢迎使用CSDN-markdown编辑器
- tcp十种状态
- EU4-41: Welcoming business guests
- 核弹
- eclipse+Scala+Maven安装
- hibernate实现原理及配置
- 【C语言】【unix c】值结果参数