+ 1
How do I write a program to generate a bank card pin?
The user input must consist of four digits between 0 and 9 and will raise an exception if : 1. The digit count is not equal to 4. 2. The intended pin includes any character outside 0-9. I'd really appreciate any explanations, guidelines or other contribution.
1 Resposta
+ 1
str1 = input()
Kamdili Ife Darachukwu
#check digit count == 4 and if all characters are numerals
if len(str1)==4 and str1.isnumeric():
print("Pass")
else:
print("Fail")