I want to iterate a list but I want to iterate only first and second elements. For the edge case, if the list has only one or zero element, it should perform iterating one or zero time.
for element in a_list:
print(element)
Use Case
a_list = [] -> ''
a_list = ['a'] -> 'a'
a_list = ['a', 'b'] -> 'ab'
a_list = ['a', 'b', 'c'] -> 'ab'
a_list = ['a', 'b', 'c', 'd'] -> 'ab'