You have a lot of issues where you don't distinguish between lists and integers.
million = [1000000, "M"]
billion = [million * 1000, "B"]
billion[0]
is not actually a 1000000 * 1000
, its a length 1000 list.
This is the root of all your problems, since now suffix[0]
becomes a list after the first iteration through your loop. The biggest change you needed was as follows:
million = [1000000, "M"]
billion = [million[0] * 1000, "B"]
trillion = [billion[0] * 1000, "T"]
quadrillion = [trillion[0] * 1000, "Qd"]
quintillion = [quadrillion[0] * 1000, "Qn"]
sx = [quintillion[0] * 1000, "Sx"]
septillion = [sx[0] * 1000, "Sp"]
This makes sure that each of these is a two element list with the proper suffix and value. Here it is all together:
suffixes = [million, billion, trillion, quadrillion, quintillion, sx, septillion]
def getSetupResult(orevalue, furnacemultiplier, *upgrades, **kwargs):
for i in upgrades:
orevalue *= i
orevalue *= furnacemultiplier
for suffix in suffixes:
if orevalue > suffix[0] - 1 and orevalue < suffix[0] * 1000:
print("$"+str(orevalue)+suffix[1])
getSetupResult(quintillion[0],700,5,4,10,100)
Output:
$14000000000000000000000000Sp
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…