알파벳을 입력하면 좋은 느낌으로 표시하는 파이썬 프로그램

17001 단어 파이썬Python3

소개



문자열 (알파벳)을 입력하면 좋은 느낌으로 콘솔에 표시하는 Python 프로그램입니다.
메일의 서명등에서, 사용할 수 있을지도. 그냥 놀이입니다.

파이썬 코드



main.py라는 파일을 만들고 아래 코드를 작성합니다.

main.py
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
그리고 명령을 실행합니다.
우선, 자신의 이름을 입력해 보았습니다.

좋은 웹페이지 즐겨찾기