|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
#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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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". |
|
#5
|
||||
|
||||
|
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. |
|
#6
|
|||
|
|||
|
thanks NetBSD, that the word I was looking for.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > newbie needs details |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|