"name": "rating", "choices": [1, 2, 3, 4, 5], }, { "type": "input", "message": "Give Review", "name": "comment", }] dcommand = {"Uninstall": False, "Update": True, "Feedback": True} a2 = prompt(q2, style=style) if a2["option"] == "Install": a3 = prompt(q3, style=style) if a3["option"] == "previously installed apps": apps = db.downloaded_app(a1["userid"], False, False) apps = dict(apps) if apps == {}: puts( colored.red( "You don't have any app in previously installed apps!") ) sys.exit() for i in apps.keys(): q4[0]["choices"].append({"name": i}) a4 = prompt(q4, style=style) elif a3["option"] == "wishlisted apps": apps = db.get_wishlist(a1["userid"], True, False) apps = dict(apps)