Update Lesson 4 Task 1 to use proper variable names

This commit is contained in:
Stanislav Mykhailenko 2023-01-27 11:53:51 +02:00
parent 2a3548933a
commit 28df09d0fa
GPG key ID: 1E95E66A9C9D6A36

View file

@ -14,8 +14,8 @@ def getValue(checkedValue):
return "no"
def printList(names, values):
for i in range(len(names)):
print(chr(ord("a") + i) + ") " + names[i] + " " + "[" + getValue(values[i]) + "]")
for number in range(len(names)):
print(chr(ord("a") + number) + ") " + names[number] + " " + "[" + getValue(values[number]) + "]")
print("y) Proceed")
def writeData(file, name, code):
@ -39,8 +39,8 @@ while True:
file_out = open("data.txt", "w")
for i in range(len(data)):
if data[i]:
writeData(file_out, names[i], code[i])
for number in range(len(data)):
if data[number]:
writeData(file_out, names[number], code[number])
file_out.close()