当前位置:网站首页>Login interface code
Login interface code
2022-07-05 13:57:00 【Beauty of algorithm and programming】
0 introduction
We have learned a lot Python knowledge , But it's abstract , I don't know the actual application of these codes in our real life . I think today app The rapidly developing information age , If we want to enter a APP Or some interface will require us to enter our account and password , This is the protection of our personal information security ; however , Do you know how the login process came about ? Today we will use a simple code to parse the source of the login interface we often encounter in our life .
1 problem
In the information age , Our biggest concern is personal privacy , When we use software , The software will collect our personal information , If criminals collect and use our information , Then the consequences will be unimaginable . therefore , We need to set the login interface , Enter the software by entering the password , So how should we do it ?
2 Method
First, create two input lines named account and password , Then enter with for in Loop to set the input opportunity to three times , Reuse if Conditional sentence to judge whether the input is correct , Report an error every time you make a mistake , If you don't lose right three times, output ‘ The user is locked ’. If the input is correct, output ‘ Successfully logged in ’.
3 Experimental results and discussion
Finally, the experiment proves that , The method performs effectively :
Code list 1
n=input(' account number :') m=input(' password :') for i in range(2): if n=='daiwei' and m=='5201314': print(' Successfully logged in ') break else: print(' Input error ') print('<'*10) print('1、 Re input ') print('2、 sign out ') option = input(" Please select :") if option=='1': n = input(' account number :') m = input(' password :') if n == 'daiwei' and m == '5201314': print(' Successfully logged in ') else: print(' This number is locked ') |
4 Conclusion
Last , Let's type out the code of the simple login interface ! The code tends to be basic , The main difficulty is to count the number of times with cycles , As for the general procedure , There will be more operations after we log in , We'll talk about the specific content next time .
边栏推荐
- Elfk deployment
- [js] basic syntax - for loop
- Blue Bridge Cup study 2022.7.5 (morning)
- 治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
- Redis6 transaction and locking mechanism
- Laravel - model (new model and use model)
- aspx 简单的用户登录
- Ueditor + PHP enables Alibaba cloud OSS upload
- Solve the problem of "unable to open source file" xx.h "in the custom header file on vs from the source
- When using Tencent cloud for the first time, you can only use webshell connection instead of SSH connection.
猜你喜欢
Simple process of penetration test
Attack and defense world crypto WP
Idea remote debugging agent
Ordering system based on wechat applet
那些考研后才知道的事
Can graduate students not learn English? As long as the score of postgraduate entrance examination English or CET-6 is high!
神经网络物联网未来现状和趋势及看法
瑞能实业IPO被终止:年营收4.47亿 曾拟募资3.76亿
Zibll theme external chain redirection go page beautification tutorial
ZABBIX monitoring
随机推荐
常见问题之PHP——Fatal error: Allowed memory size of 314572800 bytes exhausted...
2022司钻(钻井)考试题库及模拟考试
治臻新能源冲刺科创板:年营收2.2亿 上汽创投是股东
LeetCode_3(无重复字符的最长子串)
asp.net 读取txt文件
uplad_ Labs first three levels
Network security HSRP protocol
How to divide a large 'tar' archive file into multiple files of a specific size
What about data leakage? " Watson k'7 moves to eliminate security threats
Attack and defense world crypto WP
About the problem and solution of 403 error in wampserver
Those things I didn't know until I took the postgraduate entrance examination
Simple PHP paging implementation
LeetCode_67(二进制求和)
JS takes key and value from an array object to form a new object
matlab学习2022.7.4
Simple process of penetration test
Anchor navigation demo
Sqllab 1-6 exercise
LeetCode_69(x 的平方根 )