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
-----------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 divisionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started