#1
So, using Python, I am working on a project where you enter the month and it will tell you that month's birthstone. I got that far, but there's a few things I need to fine tune, and I need your help.

1. When I enter the month, it needs to be in a format of August, or July. I need to make it so I can enter the month in any case lettering, such as august, AUGUST, or AuGuSt. I'm not sure how to do this.

2. If the user enters anything else other than the month, I need a message that says "Invalid entry. Please enter a month: " or something along those lines.

Your help is greatly appreciated (that is if I get any). Here's the code I have so far:

monthNames = ['January', 'February', 'March',
'April', 'May', 'June', 'July',
'August', 'September', 'October',
'November', 'December']
birthstoneList = ['Garnet', 'Amethyst', 'Aquamarine', 'Diamond',
'Emerald', 'Pearl', 'Ruby', 'Peridot',
'Sapphire', 'Opal', 'Topaz', 'Turqoise']

month = raw_input('Enter a month: ')

listNumber = monthNames.index(month)

birthstone = birthstoneList[listNumber]

print month, "'s birthstone is ", birthstone
#3
I don't know python but you could try setting up a drop down box that makes them choose the specific spellings of the months. Similar to what you would do on a form in html
#4
If it was Java, I could help you. Visual Basic, I could help you. Python... never heard of it.
UG POKER!
Quote by WyvernOmega

TL;DR: Saw a girl at Wal-Mart, she started feeling me up, I jizzed in my pants.

Shit, I'm so pathetic.

[quote="'[BurnTheDusk"]']I agree, tone does sound better the closer your genitals are to the ground.

Crabcore?

UNACCEPTABLE
#5
never used python, just insert text that gives proper syntax instructions.
make Industrial and/or experimental electronic music? Join my group!

Last.fm
#6
Umm i don't know the python syntax but i can give you an algorithm.

1. Compare input with your array of months.
2. If it doesn't match with anything then output invalid entry.

Make sure to use a function to make all the letters either capitals or small letters and check for the month names cause otherwise you could run into problems if a person capitalises a letter.
Quote by blynd_snyper
yes we all need answers to xboys questions hurry up goddam it


Quote by Kankuro
Damn you X-Boy!!!


Founder And Member Of The " I Don't Masturbate Club "

TURNED 18 TODAY !!! (22/02)
#7
I've never used Python but after a quick Google search it looks like this should work...

replace

listNumber = monthNames.index(month)


with

listNumber = monthNames.index(string.lower(month))


And have the month names in your array lowercase instead of capitalized.
:E
#8
Just add the other spellings of the months into the list and have them also link up to the same birthstone?

Then have a function like if month is not yada then display message. I don't know python obviously but that might help.
███████
███████████
██████████████
███████████████
█████████████
███████████████
███████████
███████

#9
i dont know about python but in java you use caseSensitive or something like that
Quote by fretsonfire74
Pickup line: Hi, you'll do.
Break up: I don't like you anymore.

Quote by Rasta Dogg
I'm freakin' out here, maaaaaan
Quote by metaldud536
Send out your weakest pokemon first then switch to a stronger one to share experience points.
#10
Coconuts can be brought by a swallow, but by which type? btw, I think ^^ has the answer.
Quote by SlackerBabbath

I also have hairy butt cheeks, I once shaved a letter 'W' on each cheek, so that when I bent over it spelled WoW.

warning, some of the contents of this post may not necessarily be completely true.
#11
I tried the string idea (which was a good idea), but strings and lists are two different things. A command for a string won't work with the list. And no, I can't just enter all of the forms of the months because for one it would be annoying, and two, there is an easier way somehow, and that's what I'm trying to figure out. But thanks for all of the help so far, didn't think I was going to get any.