Question: In phython Write a program that will prompt a user to input a username and a pin code. The username can contain only letters and

In phython Write a program that will prompt a user to input a username and a pin code. The username can contain only letters and numbers, and the pin can contain only numbers. The program will do the following:

Step 1

  1. Ask a user to enter the username
  2. If the username contains letters and numbers, the program will move to step 2. Otherwise, the program will ask the user to enter letters and numbers only, and will loop until only letters and numbers are entered.

Step 2

  1. Ask a user to enter the pin code
  2. If the pin contains only numbers, the program will end. Otherwise, the program will ask a user to enter numbers only, and will loop until numbers are entered.

  1. Add an additional constraint, so the pin can contain only 4 digits. Change the user message to reflect this change.

Which string method returns True when the string contains only letters and numbers?

isalpha()

isdecimal()

istitle()

isalnum()

Which method would remove whitespace characters from this string? spam = ' It is Friday '

spam.split()

spam.rjust()

spam.strip()

spam.paste()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!