python學習----5本書,三個人各借一本,多少種借法

飞虎就是我發表於2024-05-09
book = [1, 2, 3, 4, 5]
count = 0
for a in book:
for b in book:
if a != b:
for c in book:
if c != a and c != b:
count += 1
print("第%d種:A借書%d,B借書%d,C借書%d" % (count, a, b, c))

相關文章