Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help in this python program. please help!!! I have the regex for part one: (-?d+)s*/s*(d+) *([+*/-])s*(-?d+)s*/(d+) but now i need help in part

I need help in this python program. please help!!!

I have the regex for part one: (-?\d+)\s*\/\s*(\d+) *([+*\/-])\s*(-?\d+)\s*\/(\d+)

but now i need help in part 2.

image text in transcribed

image text in transcribed

Write a regular expression patt that can be used to extract (numerator,denominator,operator,numerator,denominator) from a string containing a fraction, an arithmetic operator, and a fraction. You may assume there is a space before and after the arithmetic operator and no spaces surrounding the character in a fraction. And all fractions will have a numerator and denominator. Example: >>s 23/45 14/9" >>>re.findal I (patt,s) >>S"-23/45 1419 >>>re.findal I (patt,s) In general, your code should handle any of the operators +, * and I. -, Note: the operator module for the two argument function equivalents of the arithmetic (and other) operators Write a regular expression patt that can be used to extract (numerator,denominator,operator,numerator,denominator) from a string containing a fraction, an arithmetic operator, and a fraction. You may assume there is a space before and after the arithmetic operator and no spaces surrounding the character in a fraction. And all fractions will have a numerator and denominator. Example: >>s 23/45 14/9" >>>re.findal I (patt,s) >>S"-23/45 1419 >>>re.findal I (patt,s) In general, your code should handle any of the operators +, * and I. -, Note: the operator module for the two argument function equivalents of the arithmetic (and other) operators

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

Step: 3

blur-text-image

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

Build It For The Real World A Database Workbook

Authors: Wilson, Susan, Hoferek, Mary J.

1st Edition

0073197599, 9780073197593

More Books

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

2. Define identity.

Answered: 1 week ago

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

4. Describe phases of majority identity development.

Answered: 1 week ago