0
Help please lesson 42.2 python core
Task: We need to create a program that allows us to create our own PIN codes for bank cards. Each PIN consists of numbers. Modify the program so that when the user enters letters, the program stops and displays "Please enter a number", and when the user enters only numbers, the program displays PIN code is created ". Input example 44a5 Output example Please enter a number Code: pin = int(input()) try: print ("PIN code is created") except: print ("Please enter a number")
3 odpowiedzi
+ 1
try:
pin=int(input())
print("PIN code is created")
except:
print("Please enter a number")
0
Displays “please enter a number”
and if it doesn’t fit, it gives an error
0
if the input can be converted to integer, then the pin will create (the 1st text will print), otherwise the expect case will work