We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6081ee6 commit 178fb63Copy full SHA for 178fb63
While-Loop/problem3.py
@@ -0,0 +1,24 @@
1
+## 🎯 Challenge #3: ATM PIN System 🏦
2
+
3
+atm_pin = 1234
4
+user_id = 'kira'
5
+balance = 2500
6
+attempt = 0
7
+while True :
8
+ user_name = input("Enter The User Id :").strip().lower()
9
+ if user_name == user_id :
10
+ while attempt < 3:
11
+ atm_pass = input("Enter Your ATM PIN :").strip()
12
+ if not atm_pass.isdigit():
13
+ print("Please Enter Digits")
14
+ if atm_pass ==atm_pin:
15
+ print(f"Welcome {user_id}! Your current balance is {balance}.")
16
+ exit()
17
+ attempt += 1
18
+ print(f"Incorrect PIN Attempt Left : {3 - attempt}")
19
+ print('Too many incorrect attempts Try again some time later')
20
+ break
21
22
+ else:
23
+ print('Please enter valid user id')
24
0 commit comments