#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0

    newbie needs comments/details


    Code:
    count = 1              #1 count is a variable
    while count <= 10:  # as long as variable is less than or equal to 10
         if count != 5:    #3 if variable is 5
             print count   #4 print variables
         count = count + 1  #5
    raw_input('press the enter key to exit')
    
    # this code is suppose to print 1
                                              2
                                              3
                                              4
                                              6
                                              7
                                              8
                                              9
                                             10
    please give comments and details for lines #3 #5
    feel free to correct code and comments thanks !
    Last edited by netytan; May 5th, 2004 at 09:02 AM.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2004
    Posts
    84
    Rep Power
    11
    #3 if the variable count does not equal 5
    #4 print the value contained in the variable count
    #5 increment count; add one to the current value of count.

    please use code tags in future.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I see no reason why this code wouldnt print 1 though 10 - what exactly is the problem . I have to insist that you use code tags perfect; not that i mind adding the code tags for you too much but it does make things easier if you would do it from now on!

    Mark.
    Last edited by netytan; May 5th, 2004 at 09:07 AM.
    programming language development: www.netytan.com Hula

  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0
    thanks, what exactly are code tags ?
  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo