Python教程:打印自己的名字

news/2024/11/29 21:40:32/

要打印的名字是:PYTHON
…######…
…#…#…
…######…
…#…
…#…

…#…#…
…#…#…
…##…
…##…
…##…

…######…
…##…
…##…
…##…
…##…

…#…#…
…#…#…
…######…
…#…#…
…#…#…

…######…
…#…#…
…#…#…
…#…#…
…######…

…#…#…
…##…#…
…#.#…#…
…#…#.#…
…#…##…

# 接收用户输入
# name = input("输入你的名字: \n\n").upper()
# 字母转大写
name = 'Python'.upper()
print(f'要打印的名字是:{name}')
length = len(name)for x in range(0, length):c = name[x]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")

在这里插入图片描述


http://www.ppmy.cn/news/1201196.html

相关文章

QtC++与QLabel详解

介绍 QLabel 类是Qt中的一个用于显示文本或图像的控件类,通常用于用户界面中以提供静态文本或图片显示的功能。以下是对QLabel在Qt中的作用的详细解释: 文本和图像显示: QLabel 可以用来显示文本和图像。这使得它成为显示标签、标题、说明或…

QTcpServer 封装

来一段自封装,在用的QTcpserver,不用去找boost,或是poco,libevent……,也不用去从底层winsocket封装开始,真不用去那么折腾,放着QT自带的不用,那不仅是可惜,是辜负了QT团队的一片苦心…… #pragma once #i…

read 方法为什么返回 int 类型

在Java的输入流(InputStream)中,read方法返回int类型的值的原因是为了提供更多的信息和灵活性。虽然这可能看起来有些不直观,但有一些合理的考虑和用途,主要包括以下几点: EOF标志:read方法返回…

[科研图像处理]用matlab平替image-j,有点麻烦,但很灵活!

做材料与生物相关方向的同学应该对image-j并不陌生,前几天有个师兄拜托我用image-j分析一些图片,但使用过后发现我由于不了解image-j的工作流程而对结果并不确信,而且image-j的功能无法拓展,对有些图片的处理效果并不好&#xff0…

对内网穿透的理解

自存用 内网穿透是什么意思? - 知乎

使用 OpenTracing 和 LightStep 监控无服务器功能

无服务器功能的采用在企业组织内达到了创纪录的水平。有趣的是,鉴于越来越多的采用和兴趣,许多监控解决方案孤立了在这些环境中执行的代码的性能,或者仅提供有关执行的基本指标。为了了解应用程序的性能,我想知道存在哪些瓶颈、时…

Antv/G2 自定义tooltip鼠标悬浮提示信息

Antv/G2 提示 - Tooltip 教程 Tooltip 提示信息文档 chart.line().position(label*value).color(type).tooltip(type*value, (type:string, value:number) > { return {name: type,value: value%}}) });demo&#xff1a; <!DOCTYPE html> <html lang&quo…

Python | 安装、环境配置及包的安装

Python | 安装、环境配置及包的安装 一、前言二、python安装及编辑器配置2.1 python安装2.2 python调试2.3 python编辑器 | PyCharm2.3.1 PyCharm下载2.3.2 PyCharm安装2.3.3 PyCharm启动界面2.3.4 PyCharm初步设置2.3.5 PyCharm环境配置(含Python Interpreter配置)2.3.5.1 New…