Suppose I have a string containing the following:
'*as**4fgdfgd*vv**6fdfd5***5'
String contains numbers, letters, and a special symbol such as an asterisk.
- I need to find the sum of numbers
(4,6) (5,5)
separated byasterisk.
- The
number of asterisks
between two numbers must beequal to 3.
- Return
True
ifsum
ofevery pair
isequal to 10.
Examples:
*as**4fgdfgd*vv**6fdfd5***5
returnsTrue.
ssss*0***10jkj* **0***10
returnsTrue.
5***5***5
returnsTrue
because there 3 asterisks between the numbers and sum equals 10.8**2
returnsFalse
My Code So far:
my_str = "*as**4fgdfgd*vv**6fdfd5***5"
my_digits = [int(x) for x in my_str if x.isnumeric()]
print(sum(my_digits))