Python3 notes

简介: Python3 notes

Python 打印自己设计的字体


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

实例

name = "RUNOOB"

 

# 接收用户输入

# 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")

执行以上代码输出结果为:

..######..

..#....#..

..#.##... 

..#...#...

..#....#..



..#....#..

..#....#..

..#....#.. 

..#....#..

..######..



..#....#..

..##...#..

..#.#..#.. 

..#..#.#..

..#...##..



..######..

..#....#..

..#....#.. 

..#....#..

..######..



..######..

..#....#..

..#....#.. 

..#....#..

..######..



..######..

..#....#..

..#####... 

..#....#..

..######..

相关文章
|
8月前
|
网络协议 Python
Python3 notes
Python3 notes
|
5月前
|
存储 缓存 网络协议
复盘女朋友面试4个月的Java基础题
这篇文章是关于Java基础面试题的复盘,涵盖了HashMap原理、对象序列化作用等高频面试问题,并强调了Java基础知识的重要性。
复盘女朋友面试4个月的Java基础题
|
8月前
|
Web App开发 小程序 网络安全
Mac Charles 抓包 iPhone Https(详细流程)
Mac Charles 抓包 iPhone Https(详细流程)
790 2
|
存储 数据可视化 API
70个注意的Python小Notes
Python读书笔记:70个注意的小Notes 作者:白宁超 2018年7月9日10:58:18 摘要:在阅读python相关书籍中,对其进行简单的笔记纪要。旨在注意一些细节问题,在今后项目中灵活运用,并对部分小notes进行代码标注。
1361 0
gdy
|
SQL 监控 关系型数据库
MySQL定时备份数据库(全库备份)
一、MySQL数据备份 1.1、 mysqldump命令备份数据 在MySQL中提供了命令行导出数据库数据以及文件的一种方便的工具mysqldump,我们可以通过命令行直接实现数据库内容的导出dump,首先我们简单了解一下mysqldump命令用法: #MySQLdump常用 mysqldump -u root -p --databases 数据库1 数据库2 > xxx.
gdy
3373 0
|
5天前
|
供应链 监控 安全
对话|企业如何构建更完善的容器供应链安全防护体系
随着云计算和DevOps的兴起,容器技术和自动化在软件开发中扮演着愈发重要的角色,但也带来了新的安全挑战。阿里云针对这些挑战,组织了一场关于云上安全的深度访谈,邀请了内部专家穆寰、匡大虎和黄竹刚,深入探讨了容器安全与软件供应链安全的关系,分析了当前的安全隐患及应对策略,并介绍了阿里云提供的安全解决方案,包括容器镜像服务ACR、容器服务ACK、网格服务ASM等,旨在帮助企业构建涵盖整个软件开发生命周期的安全防护体系。通过加强基础设施安全性、技术创新以及倡导协同安全理念,阿里云致力于与客户共同建设更加安全可靠的软件供应链环境。
112377 10
|
13天前
|
弹性计算 人工智能 安全
对话 | ECS如何构筑企业上云的第一道安全防线
随着中小企业加速上云,数据泄露、网络攻击等安全威胁日益严重。阿里云推出深度访谈栏目,汇聚产品技术专家,探讨云上安全问题及应对策略。首期节目聚焦ECS安全性,提出三道防线:数据安全、网络安全和身份认证与权限管理,确保用户在云端的数据主权和业务稳定。此外,阿里云还推出了“ECS 99套餐”,以高性价比提供全面的安全保障,帮助中小企业安全上云。
201919 14
对话 | ECS如何构筑企业上云的第一道安全防线
|
2天前
|
供应链 监控 安全