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

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0

    Smile newbie needs details


    could someone please give me detailed comments (#) for the lines of code i have numbered.


    Code:
    print 'welcome to the greek eatery'
    print 'we are full'
    money = int(raw_input('how much to tip?'))   #1
    if money > 0:                                           #2
         print 'we have a table'
    else:                                                       #3
         print 'sit down and wait'
    raw_input('press the enter key to exit')

    thanks !
    Last edited by netytan; April 30th, 2004 at 11:32 PM. Reason: Added code tags, perfect please see the sticky thread on asking for help.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Canada
    Posts
    242
    Rep Power
    0
    #1: raw_input() gets input in the form of a string from the standard input (from the keyboard most likely) and int() converts it to an integer.

    #2: If the variable "money" is greater than 0, print "we have a table" to the standard output (to the screen most likely).

    #3: If money is not greater than 0 then print "sit down and wait"

    Use [ code ] [/ code] tags next time, please.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0

    newbie ? code tags & count


    newbie - explain code tags and
    what does the word ' count ' do in my previous program and what does it do.
    thanks for earlier help.
    i know count is not called a word, i'm trying to find the right
    term for it.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    Canada
    Posts
    242
    Rep Power
    0
    Use the [ code ] and [/ code ] tags (without the spaces) around your code so it includes the tabs, etc.

    As for 'count', I don't see it in your previous program, but the word you are probably looking for is "variable".
  8. #5
  9. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I dont see it either if you could make the section your talking about bold in the example above that would be a nice start. Also, i've added code tags around your previous code for you this time . Check out this thread for more info:

    http://forums.devshed.com/t131489/s.html

    Take care guys,

    Mark.

    P.S. Thanks BSD.
    programming language development: www.netytan.com Hula

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

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0
    thanks NetBSD, that the word I was looking for.

IMN logo majestic logo threadwatch logo seochat tools logo