import calendar
for i in range(1, 13):
month = calendar.month_name[i] #get month as a string
if month[0] == "J": #check first character of string
print month
--output:--
January
June
July
Since this area is a mush of a bunch of languages (the LeftOvers I call them), it’s prolly a good idea to state which language you’re using too (this looks like Python right?).
All I can do is make an idjit uneducated guess until someone else comes along:
for months in monthsOfYear:
print months[:j]
?
I mean in other languages it’s
“for singleThing in groupOfThings {
print singleThing[index];
}”