我的代码中出现以下错误,并且不知道如何解决它UnboundLocalError:分配前引用了局部变量'print'

问题描述

使用此功能,但出现以下错误UnboundLocalError:分配前引用了本地变量'print'

不知道如何解决此错误,或在哪里引用了印刷品 #最后的挑战 def room_4():

    print("welcome to the last part of the game \n")
    
    time.sleep(1)
    
    print (f"""

you are from the {tribe} tribe,this been a long journey to get to this point.
Now is the moment to use your wizar magic and human power

""")
    
    time.sleep(1)
    
    print (f"""
    
Hultwartz is looking for the best project to invest on it,the las 
challenge you asked for ${money} billion Dollars . It is important 
to understand thath humans had damaged to much the earth. 
Now profitable businesses are the ones that have a social impact and work for 
the world. 

""")
    
    time.sleep (1)
    
    print = ("""
    
    
Would you consider that investing in social impact organizations has a
positive impact for the world considering that water is getting scarce,hight temperatures are not just during summer,fires are more often,climate change is one of the consequences of migration. 
Among other reasons... 


answer YES or NO  \


""")
    
    final_challenge = input (prompt = " ")
    
    if "es" in final_challenge or "ES" in final_challenge or "Es" in final_challenge or "eS" in final_challenge:
        print (win())
    else:
        print ("xomo putas esta entrando aca")
        print ("the earth has no more water,you have 8 days to live with out it").upper()
        print (fail ())

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)