Write a function named passwords(my_list), which takes a list of passwords as an argument and returns the list containing the number of digits, number of letters and number of other characters of every password in the given list. (Hint: make sure your code removes all leading and trailing blank spaces from the passwords, if any)
Examples:
passwords(['123pass', ' pass@123', ' weakpass ']) returns [ [3,4,0] , [3,4,1] , [0,8,0] ] ->a list of lists (2D list)
Explanation: the 1st password '123pass' has 3 digits, 4 letters and 0 other characters, so the first element of the final returned list is [3,4,0]; Similarly, the 2nd password ' pass@123' has 3 digits, 4 letters and 1 other character, so the second element of the returned list is [3,4,1]; The 3rd password in the list ' weakpass ' has 0 digits, 8 letters and 0 other characters, so the third element of the returned list is [0,8,0].
passwords([ 'p@$$wor6' , ' not()404']) returns [ [1,4,3] , [3,3,2] ]
passwords(['123456789']) returns [ [9,0,0] ]
Rachel M.
I know char = characters, I'm having trouble figuring out what digit and letters would translate to in a python script02/28/23