0
Hello. Tell me, please, why code not working? THE code is called bigdigits.py
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'...
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)
0
Thanks! definitle try
0
I want to fulfill it in the Python 3