zoukankan      html  css  js  c++  java
  • 模拟exit()退出命令实现

    1.当输入exit命令是退出程序,如果输入其他的就打印====>
    方法一
    while True: username=input("请输入你的用户名:>>>") password=input("请输入你的密码:>>>") if username=='zhanghaiyan' and password=='123456': print('login successful') while True: cmd=input("请输入命令:>>>") if cmd=='exit': break print("====>",cmd) break # 方法二: tag=True while tag: username=input("请输入你的用户名:>>>") password=input("请输入你的密码:>>>") if username=='zhanghaiyan' and password=='123456': print('login successful') while tag: cmd=input("请输入命令:>>>") if cmd=='exit': tag=False continue print("====>",cmd) # 方法三: tag=True while tag: username=input("请输入你的用户名:>>>") password=input("请输入你的密码:>>>") if username=='zhanghaiyan' and password=='123456': print('login successful') while tag: cmd=input("请输入命令:>>>") if cmd=='exit': tag=False else: print("====>",cmd)
  • 相关阅读:
    Educational Codeforces Round 23E
    Educational Codeforces Round 23D
    Codeforces Round #461 (Div. 2)
    HYSBZ
    HDU
    HYSBZ
    HYSBZ
    SPOJ
    点击搜索条件提交form表单
    HTML颜色获取工具,colorpicker
  • 原文地址:https://www.cnblogs.com/haiyan123/p/7206481.html
Copyright © 2011-2022 走看看