python 打印自己代码_Python3示例——Python打印自己的字体,实例,设计

这是一个Python3程序,用户可以输入名字,程序将使用自定义的26个字母图案来打印出来。通过设定每个字母的特定图案,实现了个性化字体的展示。
摘要由CSDN通过智能技术生成

print("Python3实例-----Python 打印自己设计的字体")

'''

通过对 26 个字母的设定,设置自己要输出的字体。

'''

# 接收用户输入

name = input("输入你的名字: \n\n")

lngth = len(name)

l = ""

for x in range(0, lngth):

c = name[x]

c = c.upper()

if (c == "A"):

print("..######..\n..#....#..\n..######..", end=" ")

print("\n..#....#..\n..#....#..\n\n")

elif (c == "B"):

print("..######..\n..#....#..\n..#####...", end=" ")

print("\n..#....#..\n..######..\n\n")

elif (c == "C"):

print("..######..\n..#.......\n..#.......", end=" ")

print("\n..#.......\n..######..\n\n")

elif (c == "D"):

print("..#####...\n..#....#..\n..#....#..", end=" ")

print("\n..#....#..\n..#####...\n\n")

elif (c == "E"):

print("..######..\n..#.......\n..#####...", end=" ")

print("\n..#.......\n..######..\n\n")

elif (c == "F"):

print("..######..\n..#.......\n..#####...", end=" ")

print("\n..#.......\n..#.......\n\n")

elif (c == "G"):

print("..######..\n..#.......\n..#.####..", end=" ")

print("\n..#....#..\n..#####...\n\n")

elif (c == "H"):

print("..#....#..\n..#....#..\n..######..", end=" ")

print("\n..#....#..\n..#....#..\n\n")

elif (c == "I"):

print("..######..\n....##....\n....##....", end=" ")

print("\n....##....\n..######..\n\n")

elif (c == "J"):

print("..######..\n....##....\n....##....", end=" ")

print("\n..#.##....\n..####....\n\n")

elif (c == "K"):

print("..#...#...\n..#..#....\n..##......", end=" ")

print("\n..#..#....\n..#...#...\n\n")

elif (c == "L"):

print("..#.......\n..#.......\n..#.......", end=" ")

print("\n..#.......\n..######..\n\n")

elif (c == "M"):

print("..#....#..\n..##..##..\n..#.##.#..", end=" ")

print("\n..#....#..\n..#....#..\n\n")

elif (c == "N"):

print("..#....#..\n..##...#..\n..#.#..#..", end=" ")

print("\n..#..#.#..\n..#...##..\n\n")

elif (c == "O"):

print("..######..\n..#....#..\n..#....#..", end=" ")

print("\n..#....#..\n..######..\n\n")

elif (c == "P"):

print("..######..\n..#....#..\n..######..", end=" ")

print("\n..#.......\n..#.......\n\n")

elif (c == "Q"):

print("..######..\n..#....#..\n..#.#..#..", end=" ")

print("\n..#..#.#..\n..######..\n\n")

elif (c == "R"):

print("..######..\n..#....#..\n..#.##...", end=" ")

print("\n..#...#...\n..#....#..\n\n")

elif (c == "S"):

print("..######..\n..#.......\n..######..", end=" ")

print("\n.......#..\n..######..\n\n")

elif (c == "T"):

print("..######..\n....##....\n....##....", end=" ")

print("\n....##....\n....##....\n\n")

elif (c == "U"):

print("..#....#..\n..#....#..\n..#....#..", end=" ")

print("\n..#....#..\n..######..\n\n")

elif (c == "V"):

print("..#....#..\n..#....#..\n..#....#..", end=" ")

print("\n...#..#...\n....##....\n\n")

elif (c == "W"):

print("..#....#..\n..#....#..\n..#.##.#..", end=" ")

print("\n..##..##..\n..#....#..\n\n")

elif (c == "X"):

print("..#....#..\n...#..#...\n....##....", end=" ")

print("\n...#..#...\n..#....#..\n\n")

elif (c == "Y"):

print("..#....#..\n...#..#...\n....##....", end=" ")

print("\n....##....\n....##....\n\n")

elif (c == "Z"):

print("..######..\n......#...\n.....#....", end=" ")

print("\n....#.....\n..######..\n\n")

elif (c == " "):

print("..........\n..........\n..........", end=" ")

print("\n..........\n\n")

elif (c == "."):

print("----..----\n\n")

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值