zoukankan      html  css  js  c++  java
  • Python Homework 001

     

     1 #!/usr/bin/env python
     2 #-*- coding:utf-8 -*-
     3 
     4 import getpass
     5 name = "xilong"
     6 password = "--------"    #input your password
     7 workid = 10008179
     8 
     9 file = open("xilong.txt", "r+", encoding="utf-8") #create a file called xilong.txt first.
    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     mingzi = _name + "
    "
    17     if mingzi in namelist:
    18         print("This account has been locked!")
    19         break
    20     if _name == name and _mima == password and _workid == workid:
    21         print("Welcome to Visit StarTimes Operation&Maintenance Center!")
    22         break
    23     else:
    24         print("Invalid Account, please try again!")
    25         count += 1
    26     if count == 3:
    27         file.write("%s
    " %_name)
    28 file.close()

     

    #Becoming A Media Group with International Influence!

  • 相关阅读:
    IDLHDF5读取与转换
    IDL计算儒略日
    DOMContentLoaded和Window: load event
    eventloop(事件循环机制)
    @types
    ES6 Module import & export
    switch case
    python基础
    react-hooks 官方文档笔记
    base64编码图片
  • 原文地址:https://www.cnblogs.com/xilong-devops/p/9434357.html
Copyright © 2011-2022 走看看