Numbers in String - 2
Given a string, write a program to return the sum and average of the numbers that appear in the string, ignoring all other characters. Input-The input will be a single line containing a string. Output-The output should contain the sum and average of the numbers that appear in the string. Note: Round the average value to two decimal places.
input1-I am 25 years and 10 months old
output1-35
17.5input2-1time3 %times4
output2-8
2.67
Comments