Menu

Many works good, but some thing wrong!

mAtrIx
2006-11-15
2013-05-30
  • mAtrIx

    mAtrIx - 2006-11-15

    How can I input these sentence in console of python.

    >>> b = 0
    >>>while b < 0:
           print b
           b = b+1

     
  • Anonymous

    Anonymous - 2010-03-26

    Python is senstive to spaces, so either use the tab key (bring the keyboard up if your device doesn't have a hardware keyboard) or space it out:
    >>>b = 0
    >>>while b < 0
    …    print b
    …    b = b+1

    Of course, your example doesn't ever loop (since b < 0 is false) but if you said b = -2 before the while loop, you'd get some output.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.