我正在尝试创建一个不同的名称列表。这是我的代码,但它只会创建多个相同名称的实例。
import random
first_names=('John','Andy','Joe')
last_names=('Johnson','Smith','Williams')
full_name=random.choice(first_names)+" "+random.choice(last_names)
group=full_name*3
例如,这将显示为:
John Smith
John Smith
John Smith
但我想要类似这样的东西:
John Williams
Andy Johnson
Joe Johnson