我是 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
.lower 不適用于我在 pycharm 中的代碼
拉風(fēng)的咖菲貓
2023-08-22 17:07:09