码迷,mamicode.com
首页 > 编程语言 > 详细

Python Homework 001

时间:2018-08-07 01:28:19      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:style   lin   nan   opera   start   bee   get   line   enc   

 1 #!/usr/bin/env python
 2 #-*- coding:utf-8 -*-
 3 
 4 import getpass
 5 name = "xilong"
 6 password = "--------"
 7 workid = 10008179
 8 
 9 file = open("xilong.txt", "r+", encoding="utf-8")
10 count = 0
11 while count < 3:
12     _name = input("name:")
13     _mima = getpass.getpass("password:")
14     _workid = int(input("workid:"))
15     namelist = file.readlines()
16     print(namelist)
17     mingzi = _name + "\n"
18     if mingzi in namelist:
19         print("This account has been locked!")
20         break
21     if _name == name and _mima == password and _workid == workid:
22         print("Welcome to Visit StarTimes Operation&Maintenance Center!")
23         break
24     else:
25         print("Invalid Account, please try again!")
26         count += 1
27     if count == 3:
28         file.write("%s\n" %_name)
29 file.close()

#Becoming A Media Group with International Influence!

Python Homework 001

标签:style   lin   nan   opera   start   bee   get   line   enc   

原文地址:https://www.cnblogs.com/xilong-devops/p/9434357.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!