Question: 
Write a function to convert the given tuple to a key-value dictionary using adjacent elements.


Model's Code:
def tuple_to_dict(tup):
    return {tup[i]: tup[i + 1] for i in range(0, len(tup), 2)}



Sample Correct Code:
def tuple_to_dict(test_tup):
  res = dict(test_tup[idx : idx + 2] for idx in range(0, len(test_tup), 2))
  return (res) 


Asserts:
assert tuple_to_dict((1, 5, 7, 10, 13, 5)) == {1: 5, 7: 10, 13: 5}
assert tuple_to_dict((1, 2, 3, 4, 5, 6)) == {1: 2, 3: 4, 5: 6}
assert tuple_to_dict((7, 8, 9, 10, 11, 12)) == {7: 8, 9: 10, 11: 12}


Tests:
Test 1 of 3: PASS
Test 2 of 3: PASS
Test 3 of 3: PASS

Test 740 of 974: 561/740 (75.8108108108108%): success