Respuesta :

import random

months = ["jan", "feb", "mar", "apr", "may", "june", "july", "aug", "sept", "oct", "nov", "dec"]

pick1 = random.choice(months)

pick2 = random.choice(months)

if months.index(pick1) < months.index(pick2):

   print(pick1)

   print(pick2)

else:

   print(pick2)

   print(pick1)

Since the months are already in chronological order in the list, we can compare their index and print the string with the smaller index first. I wrote my code in python 3.8. I hope this helps.