Please create a
function with python to read a mixed numeric/alphabetic (strings)
list and then outputs the following: The sum of the numeric values
in the list
A count of the non-numeric values in the list
def printCounts(mystr):
total=0
count=0
for c in mystr:
if c.isdigit():
total+=int(c)
else:
count+=1
print("Sum of numeric digits: ",total)
print("Count of non numeric letters: ",count)
s=input("Enter string: ")
printCounts(s)
Note : Please comment below if you have concerns. I am here to help you
If you like my answer please rate and help me it is very Imp for me
Get Answers For Free
Most questions answered within 1 hours.