Question: Help with python coding.... need to have the following work in my code(below) Currently, the first 2 (I1 and I2 works) the operations ( +

Help with python coding....

need to have the following work in my code(below)

Currently, the first 2 (I1 and I2 works) the operations ( + - * / )need work

Help with python coding.... need to have the following work in my

code(below) Currently, the first 2 (I1 and I2 works) the operations (

-----------code--------------Using python 3.6

import numpy as np

import matplotlib.pyplot as plt

from scipy import *

from pylab import *

import sys

import scipy.integrate as si

from scipy.integrate import quad

class Interval:

def __init__(self,a, b=None):

if b==None:

self.b=a

self.a=a

self.b=b

m=[self.a,self.b]

def add(a,b,c,d):

m=[a+c,b+d]

def sub(a,b,c,d):

m=[a-d,b-c]

def mul(a,b,c,d):

m=[min(a*c,a*d,b*c,b*d),max(a*c,a*d,b*c,b*d)]

def div(a,b,c,d):

m=[min(a/c,a/d,b/c,b/d),max(a/c,a/d,b/c,b/d)]

def __repr__(self):

return'['+str(self.a)+','+str(self.b)+']'

def __str__(self):

return'['+str(self.a)+','+str(self.b)+']'

11= Interval (1,4) # [1,4] 12 interval (-2, -1) # [-2, -1] Il I2 I1 I2 I1 I2 I1 I2 # # [-1, 3] [2, 6] Please note: Use truediv_for the division

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!