0

Hello. Tell me, please, why code not working? THE code is called bigdigits.py

24th Feb 2017, 1:22 PM
Елена
4 ответов
+ 3
Where are you trying to execute it? Because it require to be executed on a command line ( as he get parameters by this way )... You must run it by doing: python name_of_the_source_file.py <number> Where '<number>' is a digit, and guessing you have Python installed, in your path environnement variable correctly set, and you run this command in directory ( folder ) of your 'name_of_the_source_file.py'...
25th Feb 2017, 3:52 AM
visph
visph - avatar
0
import sys Zero = [" *** ", "* *", "* *", "* *", "* *", "* *", " *** "] One = [" * ", "** ", " * ", " * ", " * ", " * ", "***"] Two = [" *** ", "* *", "* * ", " * ", " * ", "* ", "*****"] Three = [" *** ", "* *", " *", " ** ", " *", "* *", " *** "] Four = [" * ", " ** ", " * * ", " * * ", "******", " * ", " * "] Five = ["*****", "* ", "* ", " *** ", " *", "* *", " *** "] Six = [" *** ", "* *", "* ", "**** ", "* *", "* *", " *** "] Seven = ["*****", " *", " * ", " * ", " * ", "* ", "* "] Eight = [" *** ", "* *", "* *", " *** ", "* *", "* *", " *** "] Nine = [" ****", "* *", "* *", " ****", " *", " *", " *** "] Digits = [Zero, One, Two, Three, Four, Five, Six, Seven, Eight, Nine] try: digits = sys.argv[1] row = 0 while row < 7: line = " " column = 0 while column < len(digits): number = int(digits[column]) digit = Digits[number] line += digit[row] + " " column += 1 print(line) row += 1 except IndexError: print("usage: bigdigits.py <number>") except ValueError as err: print(err, "in", digits)
24th Feb 2017, 1:23 PM
Елена
0
Thanks! definitle try
25th Feb 2017, 3:44 PM
Елена
0
I want to fulfill it in the Python 3
25th Feb 2017, 3:48 PM
Елена