第一种
print("小明,10岁,男,上山去砍柴") print("小明,10岁,男,开车去东北") print("小明,10岁,男,最爱打游戏") print(" ") print("老李,90岁,男,上山去砍柴") print("老李,90岁,男,开车去东北") print("老李,90岁,男,最爱打游戏")
s1=["小明","老李"] s2=["10岁","90岁"] s3=["男"] s4=["上山去砍柴","开车去东北","最爱打游戏"] for i in range(3): print("{},{},{},{}".format(s1[0],s2[0],s3[0],s4[i])) print(" ") for j in range(3): print("{},{},{},{}".format(s1[1],s2[1],s3[0],s4[j]))