我是python编程新手,我花了3天的时间来编写这一部分的代码,真的让我抓狂。如果有人能帮我编码,我将不胜感激?你知道吗
我必须用下面的二维数组创建一个此子菜单选择。菜单必须采用以下格式:
输入M返回主菜单 否则请输入您的选择
代码
def main_menu():
listOfProducts = [["Mac Book Air","Apple","Laptop","Equipped with the new fifth-generation Intel Core i5 and i7 processors with Intel HD Graphics.",1350.5],
["Aspire SW5-111", "Acer", "Laptop", "Intel® Atom Z3745 processor Quad-core 1.33 GHz CPU.", 510],
["MeMo Pad 7", "Asus", "Tablet", "The 7 inch ASUS MeMO Pad 7 was created for those looking for a value tablet.", 620],
["Tab S8.4", "Samsung", "Tablet", "You will be surprised by the slim and sleek design of the GALAXY Tab S (8.4\") LTE. It only weighs 298g (LTE) and is easy to carry anywhere.", 788.5],
["iPhone 7", "Apple", "Phone", "The iPhone 7 is an exceptional phone in nearly every way.", 900],
["Galaxy S8", "Samsung", "Phone", "Newly released!", 1000]]
编辑:Python3代码:
python中的
enumerate()
函数返回一个元组列表,其中包含项索引和列表中的项。i、 e.上面的枚举函数返回:…一直到:
相关问题 更多 >
编程相关推荐