In the part 4, lists, the programming exercise named "Addition and removal" has a faulty test. The description of the exercise asks us to print the list after every operation "The list is printed out in the beginning and after each operation", but during the tests performed in VS code, the code doesnt clear the tests as the number of lines (if the list is printed after every action) exceeds the required no. of rows.
example:
x=1
list=[]
while True:
y=x-2
print(f"The list is now {list}")
operation=input("a(d)d, (r)emove or e(x)it:")
if operation=="d":
list.append(x)
x+=1
# print(list) (commented out to match expected output)
elif operation=="r":
if len(list)>0:
list.pop(y)
# print(list) (commented out to match expected output)
x-=1
else:
continue
elif operation=="x":
print("Bye!")
break
In the part 4, lists, the programming exercise named "Addition and removal" has a faulty test. The description of the exercise asks us to print the list after every operation "The list is printed out in the beginning and after each operation", but during the tests performed in VS code, the code doesnt clear the tests as the number of lines (if the list is printed after every action) exceeds the required no. of rows.
example:
x=1
list=[]
while True:
y=x-2
print(f"The list is now {list}")
operation=input("a(d)d, (r)emove or e(x)it:")
if operation=="d":
list.append(x)
x+=1
# print(list) (commented out to match expected output)
elif operation=="r":
if len(list)>0:
list.pop(y)
# print(list) (commented out to match expected output)
x-=1
else:
continue
elif operation=="x":
print("Bye!")
break