网站文章做内链,学科网站建设方案,免费简历模板制作网站,做淘宝可以在别的网站发信息吗我现在是一名大学生#xff0c;正在上python课程。我们的任务是用函数创建这个程序。main函数调用菜单#xff0c;然后在main函数中编写一个循环#xff0c;根据菜单函数中的用户响应访问其他函数。在我好像不能让我的循环工作。当我选择一个菜单选项时#xff0c;什么都不…我现在是一名大学生正在上python课程。我们的任务是用函数创建这个程序。main函数调用菜单然后在main函数中编写一个循环根据菜单函数中的用户响应访问其他函数。在我好像不能让我的循环工作。当我选择一个菜单选项时什么都不会发生。现在我只有print语句来测试函数的调用。在我编写函数之前我要确保它能正常工作。在如果有人有一个循环调用函数应该是什么样的示例这将对我有很大帮助。在def GetChoice():#Function to present the user menu and get their choice#local variablesUserChoice str()#Display menu and get choiceprint()print(Select one of the options listed below: )print(\tP\t\tPrint Data)print(\tA\t\tGet Averages)print(\tAZ\t\tAverage Per Zone)print(\tAL\t\tAbove Levels by Zone)print(\tBL\t\tBelow Levels)print(\tQ\t\tQuit)print()UserChoice input(Enter choice: )print()UserChoice UserChoice.upper()return UserChoicedef PrintData():print(test, test, test)def AverageLevels():print(test, test, test)def AveragePerZone():print(test, test, test)def AboveLevels():print(test, test, test)def BelowLevels():print(test, test, test)def main():Choice str()#call GetChoice functionGetChoice()#Loop until user quitsif Choice P:PrintData()elif Choice A:AverageLevels()elif Choice AZ:AveragePerZone()elif Choice AL:AboveLevels()elif Choice BL:BelowLevels()main()