@wudawufanfan
2016-09-18T11:38:02.000000Z
字数 2373
阅读 971
未分类
Use the well number character to combine the corresponding letters with the technique of programme.
key words:Python
tool
physical problems
name
代码
# -*- coding: utf-8 -*-
"""
Created on Sat Sep 17 16:53:06 2016
@author: 帆帆
"""
def alphabet_combine(string,length):
####(('#######'),('#######'),('#######'),('#######'),('#######'),('#######'),('#######'))
pa =((' # '),(' # # '),('# # '),('# ### # '),('# # '),('# # '),('# # '))
pb =((' ##### '),('# # '),('# # '),('###### '),('# # '),('# # '),(' ##### '))
pc =((' ##### '),('# # '),('# '),('# '),('# '),('# # '),(' ##### '))
pd =(('###### '),('# # '),('# # '),('# # '),('# # '),('# # '),('###### '))
pe =(('####### '),('# '),('# '),('###### '),('# '),('# '),('####### '))
pf =(('####### '),('# '),('# '),('##### '),('# '),('# '),('# '))
pg =((' ##### '),('# '),('# '),('# ### '),('# # '),('# ## '),(' #### # '))
ph =(('# # '),('# # '),('# # '),('####### '),('# # '),('# # '),('# # '))
pi =((' ##### '),(' # '),(' # '),(' # '),(' # '),(' # '),(' ##### '))
pj =((' ##### '),(' # '),(' # '),(' # '),(' # '),(' # # '),(' ### '))
pk =(('# # '),('# # '),('# # '),('#### '),('# # '),('# # '),('# # '))
pl =((' # '),(' # '),(' # '),(' # '),(' # '),(' # '),(' ##### '))
pm =(('# # '),('## ## '),('# # # # '),('# # # '),('# # '),('# # '),('# # '))
pn =(('# # '),('## # '),('# # # '),('# # # '),('# # # '),('# ## '),('# # '))
po =((' ##### '),('# # '),('# # '),('# # '),('# # '),('# # '),(' ##### '))
pp =(('###### '),('# # '),('# # '),('###### '),('# '),('# '),('# '))
pq =((' ##### '),('# # '),('# # '),('# # '),('# # # '),('# # '),(' #### # '))
pr =(('###### '),('# # '),('# # '),('###### '),('# # '),('# # '),('# # '))
ps =((' ###### '),('# '),('# '),(' ##### '),(' # '),(' # '),('###### '))
pt =(('####### '),(' # '),(' # '),(' # '),(' # '),(' # '),(' # '))
pu =(('# # '),('# # '),('# # '),('# # '),('# # '),('# # '),(' ##### '))
pv =(('# # '),('# # '),('# # '),(' # # '),(' # # '),(' # # '),(' # '))
pw =(('# # '),('# # '),('# # # '),('# # # '),('# # # '),('# # # # '),(' # # '))
px =(('# # '),(' # # '),(' # # '),(' # '),(' # # '),(' # # '),('# # '))
py =(('# # '),('# # '),(' # # '),(' # # '),(' # '),(' # '),(' # '))
pz =(('####### '),(' # '),(' # '),(' # '),(' # '),(' # '),('####### '))
p_ =((' '),(' '),(' '),(' '),(' '),(' '),(' '))
dictionary = {' ':p_,'a':pa,'b':pb,'c':pc,'d':pd,'e':pe,'f':pf,'g':pg,'h':ph,'i':pi,'j':pj,'k':pk,'l':pl,'m':pm,'n':pn,'o':po,'p':pp,'q':pq,'r':pr,'s':ps,'t':pt,'u':pu,'v':pv,'w':pw,'x':px,'y':py,'z':pz}
screen = [' ']*7
for j in range(7):
for i in range(length):
screen[j] = screen[j] + dictionary[string[i]][j]
print(screen[j])
return screen
def main():
name = input('please input your name:')
length = len(name)
name = name.lower()
alphabet_combine(name,length)
main()
以下是这次运行的结果
Thanks to Chengfeng for his codes in python 2.7 with my modification in python 3.5