""" Write a function validCard that has one parameter - string. The function returns True if the string represents valid AAA card number and False otherwise. Valid AAA card number has the following format: XXX-XXX-XXXXXXXXX-X. The length of the card number is 19 and each session consists of digits only. Write main that first reads the number of users to check. Then the program reads the card number for each user. Card numbers are stored in one dimensional list of strings. The program creates two additional one dimensional lists: first list wimake_list_string(ll include all valid card numbers and second list will include all non valid card numbers. Program prints each list and prints the number of valid cards and non valid cards. """ def make_list_string(size): list=[] for i in range(size): str=input("enter string ") list.append(str) return list def validCard(str): cond1=(len(str)==19) if(cond1==True): str1=str[0:3] str2=str[3] str3=str[4:7] str4=str[7] str5=str[8:17] str6=str[17] str7=str[18] print("parts of the string for testing purposes",str1, str2, str3, str4, str5,str6,str7) cond2=str1.isdigit() cond3=str3.isdigit() cond4=str5.isdigit() cond5=str7.isdigit() cond6=((str2=='-') and (str4=='-') and (str6=='-')) if(cond2 and cond3 and cond4 and cond5 and cond6): return True else: return False else: return False def main(): list=make_list_string(5) valid=[] nonvalid=[] for str in list: if(validCard(str)): valid.append(str) else: nonvalid.append(str) print("valid",valid) print("nonvalid",nonvalid) main()