알파벳을 입력하면 좋은 느낌으로 표시하는 파이썬 프로그램
소개
문자열 (알파벳)을 입력하면 좋은 느낌으로 콘솔에 표시하는 Python 프로그램입니다.
메일의 서명등에서, 사용할 수 있을지도. 그냥 놀이입니다.
파이썬 코드
main.py라는 파일을 만들고 아래 코드를 작성합니다.
main.pyime = input("Enter Text: \n")
for c in ime:
c = c.upper()
if (c == "A"):
print("..######..\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n")
elif (c == "B"):
print("..######..\n..#....#..\n..#####...\n..#....#..\n..######..\n\n")
elif (c == "C"):
print("..######..\n..#.......\n..#.......\n..#.......\n..######..\n\n")
elif (c == "D"):
print("..#####...\n..#....#..\n..#....#..\n..#....#..\n..#####...\n\n")
elif (c == "E"):
print("..######..\n..#.......\n..#####...\n..#.......\n..######..\n\n")
elif (c == "F"):
print("..######..\n..#.......\n..#####...\n..#.......\n..#.......\n\n")
elif (c == "G"):
print("..######..\n..#.......\n..#####...\n..#....#..\n..#####...\n\n")
elif (c == "H"):
print("..#....#..\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n")
elif (c == "I"):
print("..######..\n....##....\n....##....\n....##....\n..######..\n\n")
elif (c == "J"):
print("..######..\n....##....\n....##....\n..#.##....\n..####....\n\n")
elif (c == "K"):
print("..#...#...\n..#..#....\n..##......\n..#..#....\n..#...#...\n\n")
elif (c == "L"):
print("..#.......\n..#.......\n..#.......\n..#.......\n..######..\n\n")
elif (c == "M"):
print("..#....#..\n..##..##..\n..#.##.#..\n..#....#..\n..#....#..\n\n")
elif (c == "N"):
print("..#....#..\n..##...#..\n..#.#..#..\n..#..#.#..\n..#...##..\n\n")
elif (c == "O"):
print("..######..\n..#....#..\n..#....#..\n..#....#..\n..######..\n\n")
elif (c == "P"):
print("..######..\n..#....#..\n..######..\n..#.......\n..#.......\n\n")
elif (c == "Q"):
print("..######..\n..#....#..\n..#.#..#..\n..#..#.#..\n..######..\n\n")
elif (c == "R"):
print("..######..\n..#....#..\n..#.##...\n..#...#...\n..#....#..\n\n")
elif (c == "S"):
print("..######..\n..#.......\n..######..\n.......#..\n..######..\n\n")
elif (c == "T"):
print("..######..\n....##....\n....##....\n....##....\n....##....\n\n")
elif (c == "U"):
print("..#....#..\n..#....#..\n..#....#..\n..#....#..\n..######..\n\n")
elif (c == "V"):
print("..#....#..\n..#....#..\n..#....#..\n...#..#...\n....##....\n\n")
elif (c == "W"):
print("..#....#..\n..#....#..\n..#.##.#..\n..##..##..\n..#....#..\n\n")
elif (c == "X"):
print("..#....#..\n...#..#...\n....##....\n...#..#...\n..#....#..\n\n")
elif (c == "Y"):
print("..#....#..\n...#..#...\n....##....\n....##....\n....##....\n\n")
elif (c == "Z"):
print("..######..\n......#...\n.....#....\n....#.....\n..######..\n\n")
elif (c == " "):
print("..........\n..........\n..........\n..........\n\n")
elif (c == "."):
print("----..----\n\n")
실행 결과
방금 만든 파일
python3 main.py
그리고 명령을 실행합니다.
우선, 자신의 이름을 입력해 보았습니다.
Reference
이 문제에 관하여(알파벳을 입력하면 좋은 느낌으로 표시하는 파이썬 프로그램), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다
https://qiita.com/hiyasichuka/items/2fa50f688c00c5bdc6e4
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)
ime = input("Enter Text: \n")
for c in ime:
c = c.upper()
if (c == "A"):
print("..######..\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n")
elif (c == "B"):
print("..######..\n..#....#..\n..#####...\n..#....#..\n..######..\n\n")
elif (c == "C"):
print("..######..\n..#.......\n..#.......\n..#.......\n..######..\n\n")
elif (c == "D"):
print("..#####...\n..#....#..\n..#....#..\n..#....#..\n..#####...\n\n")
elif (c == "E"):
print("..######..\n..#.......\n..#####...\n..#.......\n..######..\n\n")
elif (c == "F"):
print("..######..\n..#.......\n..#####...\n..#.......\n..#.......\n\n")
elif (c == "G"):
print("..######..\n..#.......\n..#####...\n..#....#..\n..#####...\n\n")
elif (c == "H"):
print("..#....#..\n..#....#..\n..######..\n..#....#..\n..#....#..\n\n")
elif (c == "I"):
print("..######..\n....##....\n....##....\n....##....\n..######..\n\n")
elif (c == "J"):
print("..######..\n....##....\n....##....\n..#.##....\n..####....\n\n")
elif (c == "K"):
print("..#...#...\n..#..#....\n..##......\n..#..#....\n..#...#...\n\n")
elif (c == "L"):
print("..#.......\n..#.......\n..#.......\n..#.......\n..######..\n\n")
elif (c == "M"):
print("..#....#..\n..##..##..\n..#.##.#..\n..#....#..\n..#....#..\n\n")
elif (c == "N"):
print("..#....#..\n..##...#..\n..#.#..#..\n..#..#.#..\n..#...##..\n\n")
elif (c == "O"):
print("..######..\n..#....#..\n..#....#..\n..#....#..\n..######..\n\n")
elif (c == "P"):
print("..######..\n..#....#..\n..######..\n..#.......\n..#.......\n\n")
elif (c == "Q"):
print("..######..\n..#....#..\n..#.#..#..\n..#..#.#..\n..######..\n\n")
elif (c == "R"):
print("..######..\n..#....#..\n..#.##...\n..#...#...\n..#....#..\n\n")
elif (c == "S"):
print("..######..\n..#.......\n..######..\n.......#..\n..######..\n\n")
elif (c == "T"):
print("..######..\n....##....\n....##....\n....##....\n....##....\n\n")
elif (c == "U"):
print("..#....#..\n..#....#..\n..#....#..\n..#....#..\n..######..\n\n")
elif (c == "V"):
print("..#....#..\n..#....#..\n..#....#..\n...#..#...\n....##....\n\n")
elif (c == "W"):
print("..#....#..\n..#....#..\n..#.##.#..\n..##..##..\n..#....#..\n\n")
elif (c == "X"):
print("..#....#..\n...#..#...\n....##....\n...#..#...\n..#....#..\n\n")
elif (c == "Y"):
print("..#....#..\n...#..#...\n....##....\n....##....\n....##....\n\n")
elif (c == "Z"):
print("..######..\n......#...\n.....#....\n....#.....\n..######..\n\n")
elif (c == " "):
print("..........\n..........\n..........\n..........\n\n")
elif (c == "."):
print("----..----\n\n")
방금 만든 파일
python3 main.py
그리고 명령을 실행합니다.
우선, 자신의 이름을 입력해 보았습니다.
Reference
이 문제에 관하여(알파벳을 입력하면 좋은 느낌으로 표시하는 파이썬 프로그램), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/hiyasichuka/items/2fa50f688c00c5bdc6e4텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)