Home Backend Development Python Tutorial Python3 implements a simple bank account login system example

Python3 implements a simple bank account login system example

Aug 08, 2017 am 11:31 AM
python3 Account bank

The following editor will bring you an example of a Python3 bank account login system suitable for beginners to learn. The editor thinks it’s pretty good, so I’ll share it with you now and give it as a reference. Let’s follow the editor and take a look.

1. Knowledge points used:

1. The combination of for loop and if judgment

2. Use of %s placeholder

3. Use of auxiliary flags (flags)

4. Use of break

2. Code example:


'''
银行登录系统
'''

uname = "bob"
passwd = 123
judgment = 0
choice = 2

for i in range(3):
 username = input("请输入用户名:")
 password = int(input("请输入密码:"))
 if username == uname and password == passwd: #用户名和密码必须同时成立
  print("~~~欢迎%s使用银行自助服务系统~~~" %uname) # %s是占位符
  judgment = 1
  break
 else:
  if choice != 0:
   print("!!!登陆失败!!!" + "您还有" + str(choice) + "次机会")
  else:
   print("!!!登陆失败!!!")
  choice = choice - 1
if judgment == 0:
  print("三次机会已用完,此卡将冻结10分钟") #只是提示信息,冻结操作并未编写



# 第二种思路
# uname = "bob"
# passwd = 123
#
# choice = 2
#
# for i in range(3):
#  username = input("请输入用户名:")
#  password = int(input("请输入密码:"))
#  if username == uname and password == passwd:
#   print("~~~欢迎%s使用银行自助服务系统~~~" %uname) # %s是占位符
#
#   break
#  else:
#   if choice != 0:
#    print("!!!登陆失败!!!" + "您还有" + str(choice) + "次机会")
#   else:
#    print("!!!登陆失败!!!")
#   choice = choice - 1
# else:
#  print("三次机会已用完,此卡将冻结10分钟")
# 
#
Copy after login

The above is the detailed content of Python3 implements a simple bank account login system example. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to change account name and avatar in Win10 - Detailed step-by-step guide How to change account name and avatar in Win10 - Detailed step-by-step guide Jan 14, 2024 pm 01:45 PM

After registering a win10 account, many friends feel that their default avatars are not very good-looking. For this reason, they want to change their avatars. Here is a tutorial on how to change their avatars. If you want to know, you can come and take a look. . How to change the win10 account name and avatar: 1. First click on the lower left corner to start. 2. Then click the avatar above in the pop-up menu. 3. After entering, click "Change Account Settings". 4. Then click "Browse" under the avatar. 5. Find the photo you want to use as your avatar and select it. 6. Finally, the modification is completed successfully.

How to unlock and log in when the account referenced by win11 is locked and cannot log in How to unlock and log in when the account referenced by win11 is locked and cannot log in Jan 05, 2024 am 10:25 AM

Sometimes when we open and log in to our computer, we find that we cannot log in. In this case, we need to enter the computer settings to make changes, otherwise there will be no way to log in. What should I do if the account referenced by win11 is currently locked and may not be able to log in? 1. Click the lower left corner and enter with another account that can log in. 2. After logging in, right-click the computer and select "Manage" 3. Find local users and groups and click Users. 4. Double-click the user you cannot log in to. 5. Cancel the account ban and then restart.

How to cancel Win11 prompts that your account has been deactivated? (solved) How to cancel Win11 prompts that your account has been deactivated? (solved) Feb 09, 2024 pm 10:48 PM

After upgrading to Win11 system, many users find that "Your account has been deactivated" is displayed when logging in. What is going on? This may be because our account has been disabled for some reason or by mistake, so let me introduce the detailed solution to you below! Win11 prompts that your account has been deactivated? 1. First of all, don’t panic and click the mouse to start. 2. After clicking OK, pay attention to the fact that there will be a few more buttons in the lower right corner of the system. Click to shut down. 3. Of course, you have to turn it on after shutting it down. There are tricks in turning it on. When the grid icon appears when turning on the computer, you must press the power button immediately to shut down. You must do this in this interface more than three times in a row. 4. Wait until the prompt that you are preparing to automatically repair this interface appears.

What should I do if my account is accidentally disabled in Windows 10? What should I do if my account is accidentally disabled in Windows 10? Feb 07, 2024 pm 04:51 PM

The win10 system is very simple to operate and is loved by many users. However, due to improper operation during use, the account will be disabled. Today, the editor will bring you a solution to disabling accounts in win10 to help you solve the problem. What to do if the account is accidentally disabled in win10 1. First, the user needs to find the computer icon on the desktop, right-click and then select the management option in the pop-up window. 2. After entering the computer management interface, users can select "Local Users and Groups" in the options bar on the left, and then click the User button on the desktop. 3. Then you can find all the accounts that have logged in to the computer on the right side of the desktop. 4. Select the disabled account among all the accounts on the right, then right-click the account and click the Properties option. 5. Finally, in the account

Simple steps to check account number in WeChat Simple steps to check account number in WeChat Mar 26, 2024 pm 02:26 PM

1. After logging in to WeChat, enter the option below: [Me] 2. Select [Settings] and then find [Account and Security] to open it. 3. Then find the option [WeChat Security Center] at the bottom of the new interface and open it. 4. After entering the new page, select the first item [Retrieve Account and Password]. 5. Directly use [Appeal to retrieve WeChat account password] to enter the new interface. 6. Choose to start the appeal! You will see all the WeChat accounts that this phone has logged into.

The Bank of Korea plans to launch a digital currency pilot next year with 100,000 citizens participating The Bank of Korea plans to launch a digital currency pilot next year with 100,000 citizens participating Dec 02, 2023 am 09:25 AM

According to news from this site on December 2, the day after Bank for International Settlements General Manager Agustín Carstens visited Seoul, the Bank of Korea (BOK) announced details of the digital currency (CBDC) pilot plan, stating that there will be 10 Ten thousand selected South Korean citizens will join the pilot in the fourth quarter of next year. This website noticed that participants can use CBDC issued by commercial banks to purchase goods. The Bank of Korea, the Financial Services Commission and the Financial Supervisory Service plan to propose joint pilot tasks for banks participating in the test and separate separate tasks for each bank after consulting with relevant organizations and reviewing relevant laws. The central bank said digital currencies could solve problems with existing voucher systems, such as those used during COVID-19 or the government childcare grant system. Source

What's going on when I can't log in to my account in win10 and can't access the computer? What's going on when I can't log in to my account in win10 and can't access the computer? Jul 20, 2023 pm 04:41 PM

Many users of Windows 10 system have encountered the situation that Win10 cannot log in to the account and cannot enter the computer, and it also prompts "Cannot log in to your account. What should I do if Win10 cannot log in to the account? Usually you can log out from your account and then log in again. Log in to resolve this issue. If you don't log out immediately, any files you create or changes you make will be lost." What's going on? In fact, such problems are caused by errors in the user account. Let’s take a look at the solutions to the problem of being unable to log in to the account and access the computer in Win10. Why can't I log in to my account in Windows 10? Why can't I access the computer? The specific solutions are as follows: 1. First, we enter the safe mode of win10; 2. Enter the safe mode and check

How to unlock and use the account referenced by win10 when unable to log in? How to unlock and use the account referenced by win10 when unable to log in? Dec 29, 2023 pm 03:45 PM

Sometimes when we log in to our computer, we will encounter a prompt saying that the computer has been locked. At this time, we can enter the advanced options when booting to operate and modify. What should I do if the account referenced by win10 is currently locked and may not be able to log in? 1. Restart the computer and open the "Advanced Options" in the computer. 2. Then enter the startup settings and click Restart. 3. Then right-click the computer, choose to open "Local Users and Groups", and then uncheck "Account is disabled".

See all articles