Quiz Catalog

Catalog of quizzes

lst = [15, 30, 11, 12, 9, 0, 6, 4, 12, 13]
free_list = ["free list"]
last_element = 0
n = 0

while not any(free_list):
  free_list.append(lst[n])
  n += 1
else:
  last_element = free_list.pop()
  
print(last_element)
'free list'
  • statement/while

num = 10
sum = 0
i = 1
while i <= num:
  sum = sum + i
  i = i + 1

print(sum)
55
  • statement/while