Accepting text input

Collin collinyeung at shaw.ca
Mon May 12 00:54:28 EDT 2008


Collin wrote:
> I'm pretty new to Python, but this has really bugged me. I can't find a 
> way around it.
> 
> 
> The problem is that, when I use raw_input("sajfasjdf") whatever, or 
> input("dsjfadsjfa"), you can only have numerical values as answers.
> 
> Any help would be appreciated. Thanks.


Oh, wow. I feel so stupid. Please disregard this message. <_<

I read the error message just now a bit more carefully, and I tried 
something. I tried defining "yes" as some random numerical value. Then 
when I did:
(example code)

yes = 123123983 #some number
test = input("Test test test ")
if test == yes:
	print "It worked."
else:
	print "failed"

(example code off)

Collin



More information about the Python-list mailing list