[Python急救站课程]健康食谱搭配
健康食谱搭配输出
diet = ['西红柿', '花椰菜', '黄瓜', '牛排', '虾仁']
for x in range(0, 5):
for y in range(0, 5):
if not (x == y):
print("{}{}".format(diet[x], diet[y]))
程序运行如下:
健康食谱搭配输出
diet = ['西红柿', '花椰菜', '黄瓜', '牛排', '虾仁']
for x in range(0, 5):
for y in range(0, 5):
if not (x == y):
print("{}{}".format(diet[x], diet[y]))
程序运行如下: