Question: This part of a program, I have to do. I have to take a strings, which for example might be s= 3 * 5

This part of a program, I have to do. I have to take a string"s", which for example might be s= " 3 * 5 + 1 " and properly calculate it. I need some help getting started, thanks. Also in python 3.6

def getNextNumber(expr, pos): #expr is a given arithmetic formula in string s #pos = start position in expr #1st returned value = the next number (None if N/A) #2nd returned value = the next operator (None if N/A) #3rd retruned value = the next operator position (None if N/A) if len(expr)==0 or not isinstance(expr, str) or pos<0 or pos>=len(expr) or not isinstance(pos, int): print("type mismatch error: getNextNumber") return None, None, "type mismatch error: getNextNumber" #--- function code starts ---#

#--- function code ends ---#

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!