两个乒乓球队进行单打比赛,每队各有三人。其中甲队是a、b、c三人,乙队是x、y、z三人,已根据抽签结果确定了比赛的名单,但没有公开,有人向队员打听对战的名单。a 说:不和x比赛。c说:不和x、z比赛。请在Python3运用集合的知识点进行编程,算出三组赛手的名单。
a={"x","y","z"}
b={"x","y","z"}
c={"x","y","z"}
c=c-{"x","z"}
a=a-{"x"}
for i in a:
for j in b:
for k in c:
if len(set([i,j,k]))==3:
print('a:%s,b:%s,c:%s' %(i,j,k))