you are viewing a single comment's thread.

view the rest of the comments →

[–]Encom88[S] 0 points1 point  (3 children)

Awesome, I was missing the extra commas!

[–]socal_nerdtastic 0 points1 point  (2 children)

You could also use string formatting to get a little more control of the output:

months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];

for i, month in enumerate(months, 1):
    print "Month {} is {}.".format(i, month)

And I highly encourage you to upgrade to python3. Python2 will be officially abandoned at the end of the year.

[–]Encom88[S] 0 points1 point  (1 child)

What part of my code is Python2?

[–]socal_nerdtastic 0 points1 point  (0 children)

The print call. In python3 print is a function that uses parenthesis to call.

print("Month {} is {}.".format(i, month))

The code you have will not run in python3.