#第1种 print("小明,10岁,男,上山去砍柴") print("小明,10岁,男,开车去东北") print("小明,10岁,男,最爱打游戏") print("\n") print("老李,90岁,男,上山去砍柴") print("老李,90岁,男,开车去东北") print("老李,90岁,男,最爱打游戏") #第2种 s1=["小明","老李"] s2=["10岁","90岁"] s3=["男"] s4=["上山去砍柴","开车去东北","最爱打游戏"] for i in range(3): print("{},{},{},{}".format(s1[0],s2[0],s3[0],s4[i])) print("\n") for j in range(3): print("{},{},{},{}".format(s1[1],s2[1],s3[0],s4[j]))
原文:https://www.cnblogs.com/DCG-XC/p/13898741.html