I want to print every number and index:
nums = [3,2,1,5,6,4]
#1st code:
for i in range(len(nums)):
print(i,nums[i])
#2nd code:
length = len(nums)
for i in range(length):
print(i,nums[i])
Out of these two codes which one is efficient or are they same?