0
  1. def creating_gen(index):
  2.     months = [\\\’jan\\\’,\\\’feb\\\’,\\\’mar\\\’,\\\’apr\\\’,\\\’may\\\’,\\\’jun\\\’,\\\’jul\\\’,\\\’aug\\\’,\\\’sep\\\’,\\\’oct\\\’,\\\’nov\\\’,\\\’dec\\\’]
  3.     yield months[index]
  4.     yield months[index+2]
  5. next_month = creating_gen(3)
  6. print(next(next_month), next(next_month))
Joymercy Asked question June 9, 2023