Jan-30-2017, 10:38 PM
I need three different outputs for this function.. I cant figure out why it gives me the same answer no matter what I enter!
>>> def DSValue(bina, binb, binc):
if bina < 16 and binb < 13 and binc < 10:
dsv=0
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 19 and binb < 16 and binc < 13:
dsv=1
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 22 and binb < 19 and binc < 16:
dsv=2
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 25 and binb < 22 and binc < 19:
dsv=3
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina <26 and binb < 25 and binc < 22:
dsv=4
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
else:
print "WRONGGGG!!!"
>>> DSValue(15, 15, 15)
bina DSV = '2', binb DSV = '2', binc DSV = '2'
>>> # The answer should be
>>> # bina DSV = '0', binb DSV = '1', binc DSV = '2'
If anyone has any suggestions please let me know!!!
>>> def DSValue(bina, binb, binc):
if bina < 16 and binb < 13 and binc < 10:
dsv=0
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 19 and binb < 16 and binc < 13:
dsv=1
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 22 and binb < 19 and binc < 16:
dsv=2
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina < 25 and binb < 22 and binc < 19:
dsv=3
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
elif bina <26 and binb < 25 and binc < 22:
dsv=4
print "bina DSV = '%s', binb DSV = '%s', binc DSV = '%s'" % (dsv, dsv, dsv)
else:
print "WRONGGGG!!!"
>>> DSValue(15, 15, 15)
bina DSV = '2', binb DSV = '2', binc DSV = '2'
>>> # The answer should be
>>> # bina DSV = '0', binb DSV = '1', binc DSV = '2'
If anyone has any suggestions please let me know!!!