I am reading How to Think Like a Computer Scientist with Python. There
is a script in the exercise:

if "Ni!":
    print 'We are the Knights who say, "Ni!"'
else:
    print "Stop it! No more of this!"

if 0:
    print "And now for something completely different.."
else:
    print "Whats all this, then?"


The question asks "Explain what happened and why it happened." I my
self is confused because the output is:

We are the Knights who say, "Ni!"
Whats all this, then?

1. I was assuming that in first "if" statement we will get "Stop it!
No more of this!" because we are no setting any input and matching
string from it (in this case "Ni!").
2. I didn't get 2nd part at all.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to