def cal():
global total
box = random.choice(['石头','黄金','钻石'])
if box == '石头':
total = total + 20
elif box == '黄金':
total = total + 100
else:
total = total + 500
def cal():
global total
box = random.choice(['石头', '黄金', '钻石'])
if box == '石头':
total = total+20
elif box == '黄金':
total = total+100
else:
total = total+500
def cal():
global total
box = random.choice(['石头','黄金','钻石'])
if box == '石头':
total = total + 20
elif box == '黄金':
total = total + 200
else:
total = total + 500
def cal():
global total
box = random,choicore = (['石头','黄金','钻石'])
if box == '石头':
total = total + 20
elif box == '黄金'
total == total + 100
elif:
total = total + 500
cal()
print(total)
import random
total = 0
def cal():
global total
box = random.choice(['石头','黄金','钻石'])
if box == '石头':
total = total + 20
elif box == '黄金':
total = total + 100
else:
total = total + 500
cal()
print(total)
import random
total=0
def cal()
global total
box = random.choice(['石头', '黄金','钻石', '炸弹'])
if box == '石头':
total = total + 20
elif box == '黄金':
total = total + 100 elif box == '炸弹'
total = total -20
else:
total = total + 500
import random
def cal():
global total
total = 0
ore_list = ['石头','黄金','钻石'
box = random.choice(ore_list)
if box == '石头':
total += 20
elif box == '黄金':
total += 100
else:
total += 500