Question: This coding is for python im having a hard time coming up with a solution for this question can you provide the crrec code for

This coding is for python im having a hard time coming up with a solution for this question

can you provide the crrec code for this qustion?

This coding is for python im having a hard time coming up

Coding Exercise: Credit Check You have been hired by MeisterCard to write a function which checks if a given credit card number is valid Your function check(S) should take a string S as input. First, if the string does not follow the format "#### #### #### ####" where each # is a digit, then it should return False. Then, if the sum of the digits is divisible by 10 (a "checksum" method), then the procedure should return True, else it should return False. For example, if S is the string "9384 3495 3297 0123" then although the format is correct, the digit sum is 72 so you should return False if len(S) != 19 and S[4] != '' and S[9] != '' and S[14] !- '': return False # checking if the format is correct 4 5S-S.replace("",'") 6 if not S.isdigitO: 7 # Taking away spaces in the string return False # checking that the string has only numbers 10 for i in S: i -int(i) L.append(i) # Making a list out of the string and converting E 12 13 14 if sum(L)//10 != 0: # checking to see if the sum of the list is divisible return False Run program Enter test statements Open in console Visualize More actions... Did not pass tests. Please check details below and try again. Program executed without crashing

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!