Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students explore these related Databases questions