1 Replies - 1182 Views - Last Post: 09 March 2008 - 11:37 PM Rate Topic: -----

#1 *Jas*  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 11
  • Joined: 29-February 08

while loops..

Posted 09 March 2008 - 12:13 PM

How many times will python execute the code inside the while loops,below?


i = 1
while i < 10000 and i > 0 and 1 :
print "still going ..."
i = 2 * i





i = 1
while i < 10000 and i > 0 and 0 :
print "still going ..."
i = 2 * i





i = 1
while i < 2048 and i > 0 :
print "still going ..."
i = 2 * i




Is This A Good Question/Topic? 0
  • +

Replies To: while loops..

#2 KevinADC  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 27
  • View blog
  • Posts: 401
  • Joined: 23-January 07

Re: while loops..

Posted 09 March 2008 - 11:37 PM

hmmm..... odd questions you have.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1