newbe question about Sting Comparison
- To: mathgroup at smc.vnet.net
- Subject: [mg107010] newbe question about Sting Comparison
- From: "Biff. Bartolemew" <harrytuttle777 at mac.com>
- Date: Sun, 31 Jan 2010 05:58:58 -0500 (EST)
Hello,
I hope someone can help me out, and not laugh to hard at my stupidity,
but, I am trying write a little program
playAGame[] := Module[
{car},
ans = Input["Would you like to play a game"];
Print[ans];
If[ans == "yes", Print["you answered yes"],
Print["you did not answer yes"]
];
If[5 == 5, Print["You suck"], Print["You Rock"]];
]
The first If statement does not seem to be evaluated.
Yet, if I type:
"yes"=="yes", I get the answer I am looking for.
It seems like the string comparison is acting different in the middle of
the If statement. Can someone tell me what I am doing wrong?
-Thanks
- Follow-Ups:
- Re: newbe question about Sting Comparison
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: newbe question about Sting Comparison