Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 30th, 2004, 08:18 PM
perfect20002 perfect20002 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 28 perfect20002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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.

Reply With Quote
  #2  
Old April 30th, 2004, 08:54 PM
NetBSD NetBSD is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Canada
Posts: 234 NetBSD Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 9 h 25 m 35 sec
Reputation Power: 0
Send a message via MSN to NetBSD
#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.

Reply With Quote
  #3  
Old April 30th, 2004, 10:00 PM
perfect20002 perfect20002 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 28 perfect20002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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.

Reply With Quote
  #4  
Old April 30th, 2004, 11:25 PM
NetBSD NetBSD is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Location: Canada
Posts: 234 NetBSD Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 9 h 25 m 35 sec
Reputation Power: 0
Send a message via MSN to NetBSD
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".

Reply With Quote
  #5  
Old April 30th, 2004, 11:38 PM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 3 m 4 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
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


Reply With Quote
  #6  
Old May 4th, 2004, 07:37 PM
perfect20002 perfect20002 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 28 perfect20002 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks NetBSD, that the word I was looking for.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > newbie needs details


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway