Question: PYTHON 3.6 Prob. 3 Develop a function that meets the requirement in the document string of sumDigits: def sumDigits (s): 'Input s is a string.
PYTHON 3.6

Prob. 3 Develop a function that meets the requirement in the document string of sumDigits: def sumDigits (s): 'Input s is a string. The returned value should be the sum of all numerical digits ins In addition, if the first non-empty char of s is a minus sign, then the returned value should add a minus sign to the sum. E.g., sumDigits("A33$%C++D ' ) should return 10, sunn Digits('-+2338964-D') 4 6 and sumDigits(-A+3-3-4*D' should both return -10 That is, minus sign matters only when it is the first non-empty char You may need to look up s.isdigit , s.1strip( from help (str) 10
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
