create tuple from ranges in python
create tuple from ranges in python Question: Is there a way in python to create a tuple of months and years (as: [(2020, 1),(2020,2)…] ) by using the tuple() function? My code: monthyears = [] for y in range(2020,2017,-1): if y == 2018: m_end = 6 else: m_end = 0 for m in range(12,m_end,-1): monthyears.append((y,m)) …