{"id":161,"date":"2020-09-26T12:40:03","date_gmt":"2020-09-26T12:40:03","guid":{"rendered":"https:\/\/dft.wiki\/?p=161"},"modified":"2026-06-09T15:13:16","modified_gmt":"2026-06-09T19:13:16","slug":"simple-ascii-art-in-python","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=161","title":{"rendered":"Simple ASCII Art in Python"},"content":{"rendered":"<p>This program converts a name, word, or phrase from a single line into ASCII Art spread across five lines.<\/p>\n<p>Just copy, paste and run this code:<\/p>\n<pre>alpha = [ [' AAA ',' A A ',' AAAAA ',' A A ',' A A '] , [' BBBB ',' B B ',' BBBB ',' B B ',' BBBB '] , [' CCCCC ',' C ',' C ',' C ',' CCCCC '] , [' DDD ',' D D ',' D D ',' D D ',' DDD '] , [' EEEEE ',' E ',' EEEEE ',' E ',' EEEEE '] , [' FFFFF ',' F ',' FFFF ',' F ',' F '] , [' GGGGG ',' G ',' G GGG ',' G G ',' GGGGG '] , [' H H ',' H H ',' HHHHH ',' H H ',' H H '] , [' III ',' I ',' I ',' I ',' III '] , [' J ',' J ',' J ',' J J ',' JJJJ '] , [' K K ',' K K ',' KKK ',' K K ',' K K '] , [' W ',' W ',' W ',' W ',' W '] , [' L ',' L ',' L ',' L ',' LLLLL '] , [' M M ',' MM MM ',' M M M ',' M M ',' M M '] , [' N N ',' NN N ',' N N N ',' N NN ',' N N '] , [' OOO ',' O O ',' O O ',' O O ',' OOO '] , [' PPPP ',' P P ',' PPPP ',' P ',' P '] , [' QQQ ',' Q Q ',' Q Q ',' Q QQ ',' QQQQ '] , [' RRRR ',' R R ',' RRRR ',' R R ',' R R '] , [' SSSS ',' S ',' SSS ',' S ',' SSSS '] ,[' TTTTT ',' T ',' T ',' T ',' T '] , [' U U ',' U U ',' U U ',' U U ',' UUU '] , [' V V ',' V V ',' V V ',' V V ',' V '] , [' X X ',' X X ',' X ',' X X ',' X X '] , [' Y Y ',' Y Y ',' Y ',' Y ',' Y '] , [' ZZZZZ ',' Z ',' Z ',' Z ',' ZZZZZ '] , [' ',' ',' ',' ',' '] , [' ',' ',' ----- ',' ',' '] ]\r\nabc = 'abcdefghijkwlmnopqrstuvxyz -'\r\nword = input('Type one word or name: ')\r\nprint()\r\nword = word.lower()\r\nline = ['','','','','']\r\ni = 0\r\nj = 0\r\nn = len(word)\r\nwhile i &lt; 5 :\r\nwhile j &lt; n :\r\nline[i] = line[i] + alpha[abc.index(word[j])][i]\r\nj += 1\r\nprint(line[i])\r\nj = 0\r\ni += 1\r\n<\/pre>\n<p>The program will ask you to enter a word or name (in lower or upper case). Here is the result for: PYTHON<\/p>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"wp-image-121 aligncenter\" src=\"https:\/\/dft.wiki\/wp-content\/uploads\/sites\/15\/2020\/09\/image-2-1-1.png\" alt=\"\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>This program converts a name, word, or phrase from a single line into ASCII Art [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-programming"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/161","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=161"}],"version-history":[{"count":9,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":5863,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/161\/revisions\/5863"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}