PYTHON- Credit card numbers follow a standard system. For example, Visa, MasterCard, and Discover Card all
have 16 digits, and the first digit serves to indicate the card brand. All Visa cards start with a 4;
MasterCard cards always starts with a 5; and Discover cards start with a 6. Write out a program that
prompts for a credit card number and emits the name of the brand. If the card brand cannot be
determined, the program should output "Unknown Card"

Relax

Respuesta :

Answer:

ccard = input("What is your credit card #: ")

if ccard[0] == 4:

   print("Visa")

elif ccard[0] == 5:

   print("MasterCard")

elif ccard[0] == 6:

   print("Discover")

else:

   print("Unknown Card")