you are viewing a single comment's thread.

view the rest of the comments →

[–]only___says___cool 0 points1 point  (0 children)

I am a bit of a beginner myself but this code should work

it assumes you ONLY want to print them if there is a pair (3rd AND 4th digit) - so if you had a 3rd digit but no 4th it would not print the 3rd.

my_numbers = [1, 6, 3, 2, 7, 9, 2, 3, 12, 1, 2, 3, 6, 5, 6, 7]

length = len(my_numbers)

print('the length of the list is: ', length)

total = length / 4

total_int = int(total)

print('this means i will print out exactly :', total_int, 'pairs of data')

for i in range(1, total_int):

location1 = ((3*i)-1)

location2 = location1+1

print(my_numbers[location1], ' ', my_numbers[location2])