Hi Tutor,

I am new to python, and a novice in the world of programming, I am learning 
python from learnpythonthehardway, and now a little bit confused in exercise 3, 
where the author of the book wants us to rewrite the ex3.py by saying 
Rewrite ex3.py to use floating point numbers so it’s more accurate (hint: 20.0 
is floating point).

so I have written the source code in this manner using floating points, here it 
is:

 

print "I will now count my chickens:"


print "Hens",25+30.0/6


print "Roosters",100 - 25.0 * 3.0 % 4


print "Now I will count the eggs:"


print 3+2+1-5.0+4.0%2-1/4.0+6

 

print "Is it true that 3+2<5-7?"

 

print 3+2<5-7

 

print "What is 3+2?",3+2
print "What is 5-7?",5-7

 

print "Oh, that's why it's False."

 

print "How about some more."

 

print "Is it greater?", 5>-2

 

print "Is it greater or equal?", 5>=-2
print "Is it less or equal?", 5<=-2

 

print 3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6


 

kindly check that whether I have done right?

 

thanks a lot

waiting for ur reply

Sent from Windows Mail
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to