Question: Write a function recSymCount ( ) that computes and returns the number of math symbols in a string provided as a parameter. The special symbols

Write a function recSymCount() that computes and returns the number of math symbols in a
string provided as a parameter. The special symbols are '+','-','*','/', and '='. The only string
functions you are allowed to use are len(), comparisons (==,=, etc.) and string indexing or slicing
(e.g. s[i] or s[i:j] for integers i and j). The following shows several sample runs of the function:File Edit Shell Debug Options Windows Help
recSymCount ('5+4*3=?')
3
val = recSymCount ('The question is: 1+2')
val
1
recSymCount ('+3 or -1 is the factor')
2
recSymCount ('))
0
1
 Write a function recSymCount() that computes and returns the number of

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!