So I've completed a project I was working on but I'm trying to find a way to make it more pythonic in a sense that takes less lines and well looks cleaner. I've been told before that if it isn't broken it shouldn't be fix but always looking for a better way to improve my programming.
So I have a tuple n with these values:
n = ((100,200), (300,400),(500,600))
for i, x in enumerate(n):
if i is 0: D = x[0]
if i is 1: M = x[0]
if i is 2: s = x[0]
print D, M, s
where (D, M, s) should print out:
100, 300, 500
Is there a way to write those if statement since they are all going to be the first value always every time it loops through the tuple?