标签:alt sed display opened lcd data inpu range utf-8
将数字转换为LCD模式
代码如下:
1 # -*- coding:utf-8 -*- 2 ‘‘‘ 3 Python 小练习-1 : 将数字转换为LCD显示 4 ‘‘‘ 5 lt = [‘ __ ‘, ‘|__ ‘, ‘|__|‘, ‘ |‘, ‘ __|‘, ‘| |‘, ‘ ‘] 6 dt = {0:[0, 5, 2],1:[6, 3, 3], 2:[0, 4, 1], 3:[0, 4, 4], 4:[6, 2, 3], 5:[0, 1, 4], 6:[0, 1, 2], 7:[0, 3, 3], 8:[0, 2, 2], 9:[0, 2, 4]} 7 8 data = input() 9 for i in range(3): 10 for j in data: 11 print(lt[dt[int(j)][i]], end=‘ ‘) 12 print(‘‘)
标签:alt sed display opened lcd data inpu range utf-8
原文地址:http://www.cnblogs.com/liyang93/p/6606826.html