Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the followin Anaconda Spyder algorithm, create 3 desk checks for the following 3 inputs: colors2res(('VT','YE','RD','GN')) , colors2res(('VT','YE','RD','-')) , colors2res(('VT','GD','RD','GN')) def colors2res (tuple): sigfig={'-':'-','PK':'-','SR':'-','GD':'-','BK':0,'BN':1,'RD':2,'OG':3,'YE':4,'GN':5,'BU':6,'VT':7,'GY':8,'WH':9} mult={'-':'-','PK':10**(-3),'SR':10**-2,'GD':10**-1,'BK':10**0,'BN':10**1,'RD':10**2,'OG':10**3,'YE':10**4,'GN':10**5,'BU':10**6,'VT':10**7,'GY':10**8,'WH':10**9}

Using the followin Anaconda Spyder algorithm, create 3 desk checks for the following 3 inputs: colors2res(('VT','YE','RD','GN')) , colors2res(('VT','YE','RD','-')) , colors2res(('VT','GD','RD','GN'))

def colors2res (tuple): sigfig={'-':'-','PK':'-','SR':'-','GD':'-','BK':0,'BN':1,'RD':2,'OG':3,'YE':4,'GN':5,'BU':6,'VT':7,'GY':8,'WH':9} mult={'-':'-','PK':10**(-3),'SR':10**-2,'GD':10**-1,'BK':10**0,'BN':10**1,'RD':10**2,'OG':10**3,'YE':10**4,'GN':10**5,'BU':10**6,'VT':10**7,'GY':10**8,'WH':10**9} perc={'-':20,'PK':'-','SR':10,'GD':5,'BK':'-','BN':1,'RD':2,'OG':0.05,'YE':0.02,'GN':0.5,'BU':0.25,'VT':0.1,'GY':0.01,'WH':'-'} try: s=(sigfig[tuple[0]]*10+sigfig[tuple[1]])*mult[tuple[2]] t=perc[tuple[3]] return (s,t) except: return (float('nan'),float('nan'))

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

Students also viewed these Databases questions