.lower不适用于我在pycharm中的代码

问题描述

我是python的新手,这是我的代码,.lower通常可以使用,但这次却不行。

technical_dict = {
        dict : 'stores a key/value pair',list : 'stores a value at each index',map : 'see dict',set : 'stores unordered unique elements'
    }

    userInput = (input("What term would you like to lookup or type 'exit' to stop:"))
    if userInput.lower() not in technical_dict:
        print("Term does not exist in technical dictionary")
    if userInput.lower()  in technical_dict:
        print(technical_dict[userInput.lower()])
        while userInput.lower() != "exit":
            userInput = input("What term would you like to lookup or type 'exit' to stop:")
            if userInput.lower() in technical_dict:
        print(technical_dict[userInput.lower()])
            if userInput.lower() not in technical_dict:
                print("Term does not exist in technical dictionary")
                break

解决方法

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

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

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