Numero de tarjeta
Publicado por Angel (7 intervenciones) el 16/07/2019 03:18:36
Hola, este ejercicio me esta tomando muchisimo. alguien que me pueda ayudar? si es de la CDMx podríamos tener una clase.
def verify(number) : # do not change this line!
# write your code here so that it verifies the card number
# be sure to indent your code!
return True # modify this line as needed
input = "5000-0000-0000" # change this as you test your function
output = verify(input) # invoke the method using a test input
print(output) # prints the output of the function
# do not remove this line!
y estas son las condiciones
1. The first digit must be a 4.
2. The fourth digit must be one greater than the fifth digit; keep in mind that these are
separated by a dash since the format is ####-####-####.
3. The sum of all digits must be evenly divisible by 4.
4. If you treat the first two digits as a two-digit number, and the seventh and eighth digits
as a two-digit number, their sum must be 100.
algo de guía por favor?
def verify(number) : # do not change this line!
# write your code here so that it verifies the card number
# be sure to indent your code!
return True # modify this line as needed
input = "5000-0000-0000" # change this as you test your function
output = verify(input) # invoke the method using a test input
print(output) # prints the output of the function
# do not remove this line!
y estas son las condiciones
1. The first digit must be a 4.
2. The fourth digit must be one greater than the fifth digit; keep in mind that these are
separated by a dash since the format is ####-####-####.
3. The sum of all digits must be evenly divisible by 4.
4. If you treat the first two digits as a two-digit number, and the seventh and eighth digits
as a two-digit number, their sum must be 100.
algo de guía por favor?
Valora esta pregunta


0