Newbie that don't understand

Martin Ståhl martin.stahl at telia.com
Sat Jun 29 13:00:16 EDT 2002


I have never been programming before and now I am reading the
"Non-Programmers Tutorial For Python"
http://www.honors.montana.edu/~jjc/easytut/easytut/node9.html#SECTION0091000
0000000000000
And don't understand the following
I quote

"To start off this chapter I am going to give you a example of what you
could do but shouldn't (so don't type it in):

a = 23
b = -23

if a < 0:
    a = -a

if b < 0:
    b = -b

if a == b:
    print "The absolute values of", a,"and",b,"are equal"
else:
    print "The absolute values of a and b are different"

with the output being:
The absolute values of 23 and 23 are equal"

how can 23 and -23 be equal?





More information about the Python-list mailing list