Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #44624
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.134.4.91.MISMATCH!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <l.selmi@icloud.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.005 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'exercise': 0.04; 'elif': 0.05; 'received:192.168.1.101': 0.09; 'sfxlen:2': 0.11; 'python': 0.11; 'def': 0.12; 'wrote': 0.14; "'courier": 0.16; '14px;': 0.16; '2px': 0.16; '8px': 0.16; 'answers:': 0.16; 'box-sizing:': 0.16; 'inherit;': 0.16; 'kindest': 0.16; 'monaco,': 0.16; 'monospace;': 0.16; "new',": 0.16; 'rent': 0.16; 'think?': 0.16; '<': 0.19; 'stack': 0.19; 'seems': 0.21; 'input': 0.22; 'to:name:python-list@python.org': 0.22; 'cc:addr:python.org': 0.22; 'days,': 0.24; 'cc:2**0': 0.24; 'code:': 0.26; 'skip:" 20': 0.27; 'function': 0.29; '(this': 0.29; '50,': 0.31; 'bug?': 0.31; 'conditions:': 0.31; 'initial;': 0.31; 'thanks!': 0.32; 'but': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'received:17': 0.38; 'to:addr:python-list': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'days': 0.60; 'more': 0.64; '15px;': 0.68; 'car': 0.72; 'arial,': 0.74; 'helvetica,': 0.74; 'day': 0.76; 'sans-serif;': 0.78; '$50': 0.84; "'helvetica": 0.84; 'again!': 0.84; "neue',": 0.84; 'subject:..': 0.84; 'dollars': 0.97 |
| X-Proofpoint-Virus-Version | vendor=fsecure engine=2.50.10432:5.10.8626,1.0.431,0.0.0000 definitions=2013-05-02_06:2013-05-02, 2013-05-02, 1970-01-01 signatures=0 |
| X-Proofpoint-Spam-Details | rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=8 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1302030000 definitions=main-1305020107 |
| From | leonardo selmi <l.selmi@icloud.com> |
| Content-type | multipart/alternative; boundary="Apple-Mail=_AF9AB54E-797B-43FC-9AF2-14F8F97462D4" |
| Subject | help.. |
| Date | Thu, 02 May 2013 15:56:28 +0200 |
| To | "python-list@python.org" <python-list@python.org> |
| MIME-version | 1.0 (Mac OS X Mail 6.2 \(1499\)) |
| X-Mailer | Apple Mail (2.1499) |
| Cc | "help@python.org" <help@python.org> |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1236.1367502996.3114.python-list@python.org> (permalink) |
| Lines | 144 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1367502996 news.xs4all.nl 15943 [2001:888:2000:d::a6]:37681 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:44624 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
i have also this program:
write a function called rental_car_costthat takes days as input and returns the cost for renting a car for said number of days. The cost must abide by the following conditions:
Every day you rent the car is $40.
If you rent the car for 3 or more days, you get $20 off your total.
If you rent the car for 7 or more days, you get $50 off your total. (This does not stack with the 20 dollars you get for renting the car over 3 days.)
so i wrote the following code:
def rental_car_cost(days):
cost = 40*days
if days >= 7:
return cost - 50
elif days >= 3 and days < 7:
return cost - 20
else:
return cost
but it seems not to be right cause the computer answers: Oops, try again! Did you create a function called rental_car_cost?
ii wrote also:
def rental_car_cost(days):
if days >= 7:
return (40*days) - 50
if days >= 3 and < 7:
return (40*days) - 20
else:
return (40*days)
they both work in python shell/idle but not in the exercise in "codecademy"..what do you think? is there a bug?
thanks!
kindest regards
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
help.. leonardo selmi <l.selmi@icloud.com> - 2013-05-02 15:56 +0200
csiph-web