global_sulfur=0
global_charcoal=0
global_gun_powder=0
global_low_grade_fuel=0
global_metal_frags=0
global_stone=0
global_tech_trash=0
global_cloth=0
global_explosives=0
global_rope=0
global_small_stash=0
global_beancan_grenade=0
global_metal_pipe=0
global_spring=0
global_animal_fat=0
def calculate():
list={"Sulfur" : global_sulfur ,"Charcoal" : global_charcoal ,"Gun Powder" : global_gun_powder ,"Low Grade Fuel" : global_low_grade_fuel , "Metal Frags" : global_metal_frags , "Stone" : global_stone , \
"Tech Trash" : global_tech_trash ,"Cloth" : global_cloth ,"Explosives" : global_explosives ,"Rope" : global_rope ,"Small Stash" : global_small_stash ,"Beancan Grenades" : global_beancan_grenade ,"Metal Pipe" : global_metal_pipe \
,"Spring" : global_spring ,"Animal Fat" : global_animal_fat}
Theres 700+ more lines,but we want to make this questions simple,just think of the least of the variables will have a value over one。如果字典中的語句打印一個鍵和值,如果該值大於一,我該怎麼辦?
我試過多種方式和無數的時間,試圖找到一種方法,使該值是否超過鍵值,將打印價值和鍵超過1
你不應該影響'list',特別是不能用*實際上不是列表*的東西。你也應該閱讀教程。 – jonrsharpe