# 元组的案例演示

number = input("请输入一个数字：")

for i inrange(len(number)):

if "0" in number[i]:

print("", end="")

if "1" in number[i]:

print("", end="")

if "2" in number[i]:

print("", end="")

if "3" in number[i]:

print("", end="")

if "4" in number[i]:

print("", end="")

if "5" in number[i]:

print("", end="")

if "6" in number[i]:

print("", end="")

if "7" in number[i]:

print("", end="")

if "8" in number[i]:

print("", end="")

if "9" in number[i]:

print("", end="")

if "." in number[i]:

print("", end="")

chinese_number = ("", "", "", "", "", "", "", "", "", "")

number = input("请输入一个数字：")

for i inrange(len(number)):

if "." in number[i]:

print("", end="")

else:

print(chinese_number[int(number[i])],end="")

C:\python\python.exeC:/python/demo/file3.py

Process finished with exit code 0

poker_type= ("♠", "♥", "♦","♣")

poker_number = ("3","4", "5", "6","7", "8", "9","10", "J", "Q","K", "A", "2")

poker_list = []

for i inpoker_number:

for j in poker_type:

poker_list.append(j+i)

print(len(poker_list))

print(poker_list)

C:\python\python.exeC:/python/demo/file3.py

52

['♠3','♥3', '♦3','♣3', '♠4','♥4', '♦4','♣4', '♠5','♥5', '♦5','♣5', '♠6','♥6', '♦6','♣6', '♠7','♥7', '♦7','♣7', '♠8','♥8', '♦8','♣8', '♠9','♥9', '♦9','♣9', '♠10','♥10', '♦10','♣10', '♠J','♥J', '♦J','♣J', '♠Q','♥Q', '♦Q','♣Q', '♠K','♥K', '♦K','♣K', '♠A','♥A', '♦A','♣A', '♠2','♥2', '♦2','♣2']

Process finished with exit code 0