Update Lesson 4 Task 1 to use proper variable names
This commit is contained in:
parent
2a3548933a
commit
28df09d0fa
1 changed files with 5 additions and 5 deletions
|
@ -14,8 +14,8 @@ def getValue(checkedValue):
|
||||||
return "no"
|
return "no"
|
||||||
|
|
||||||
def printList(names, values):
|
def printList(names, values):
|
||||||
for i in range(len(names)):
|
for number in range(len(names)):
|
||||||
print(chr(ord("a") + i) + ") " + names[i] + " " + "[" + getValue(values[i]) + "]")
|
print(chr(ord("a") + number) + ") " + names[number] + " " + "[" + getValue(values[number]) + "]")
|
||||||
print("y) Proceed")
|
print("y) Proceed")
|
||||||
|
|
||||||
def writeData(file, name, code):
|
def writeData(file, name, code):
|
||||||
|
@ -39,8 +39,8 @@ while True:
|
||||||
|
|
||||||
file_out = open("data.txt", "w")
|
file_out = open("data.txt", "w")
|
||||||
|
|
||||||
for i in range(len(data)):
|
for number in range(len(data)):
|
||||||
if data[i]:
|
if data[number]:
|
||||||
writeData(file_out, names[i], code[i])
|
writeData(file_out, names[number], code[number])
|
||||||
|
|
||||||
file_out.close()
|
file_out.close()
|
||||||
|
|
Reference in a new issue