Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Feb 13th, 2005, 11:42 AM   #1
arod199113
Programmer
 
arod199113's Avatar
 
Join Date: Feb 2005
Posts: 86
Rep Power: 0 arod199113 is an unknown quantity at this point
case sensative

can you make python not case sensative?
i have python2.0
arod199113 is offline   Reply With Quote
Old Feb 13th, 2005, 12:41 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I doubt it. Why would you want to do that, anyway?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Feb 13th, 2005, 1:05 PM   #3
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 707
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
I'm sure you could if you messed with the source code, but it would take a hell of a lot of work. Get used to case sensitive, it makes life orginized
thechristelegacy is offline   Reply With Quote
Old Feb 13th, 2005, 8:32 PM   #4
arod199113
Programmer
 
arod199113's Avatar
 
Join Date: Feb 2005
Posts: 86
Rep Power: 0 arod199113 is an unknown quantity at this point
Quote:
Originally Posted by Ooble
I doubt it. Why would you want to do that, anyway?
u did answer my other question with the
if a == "ball" or a == "cat"
that was an example, but i had a program were it would ask you yes or no
and i wanted it to except "yes" and "Yes" and respond the same thing without having to type each one out indevidualy
arod199113 is offline   Reply With Quote
Old Feb 13th, 2005, 9:06 PM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Ah... that's not making Python case-sensitive - that's making your program case sensitive. To do it, just convert it to lowercase, and test it like that:
import string # this makes your program include the string functions

a = string.lower(raw_input("Type either ball, cat, dog, or eat:"))
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 11:38 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC