Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40285

need for help

Path csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!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.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'error:': 0.05; 'arguments': 0.07; 'constructor': 0.07; 'msg': 0.07; 'subject:help': 0.07; 'typed': 0.09; 'typeerror:': 0.09; 'def': 0.10; 'size,': 0.13; 'lot!': 0.16; 'subject:need': 0.17; 'skip:" 30': 0.20; 'to:name:python-list@python.org': 0.20; 'color,': 0.22; '(most': 0.27; 'ball': 0.29; 'class': 0.29; 'file': 0.32; 'print': 0.32; '11,': 0.33; 'traceback': 0.33; 'to:addr:python-list': 0.33; 'guys': 0.33; 'thanks': 0.34; 'direction': 0.35; 'received:17': 0.35; 'but': 0.36; 'charset:us-ascii': 0.36; 'to:addr:python.org': 0.39; 'takes': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'kindly': 0.67; 'color': 0.69
X-Proofpoint-Virus-Version vendor=fsecure engine=2.50.10432:5.9.8327,1.0.431,0.0.0000 definitions=2013-03-01_05:2013-03-01, 2013-03-01, 1970-01-01 signatures=0
X-Proofpoint-Spam-Details rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1212290000 definitions=main-1303010167
From leonardo selmi <l.selmi@icloud.com>
Content-type text/plain; charset=us-ascii
Content-transfer-encoding 7bit
Subject need for help
Date Fri, 01 Mar 2013 19:35:14 +0100
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)
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.2750.1362166527.2939.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1362166527 news.xs4all.nl 6943 [2001:888:2000:d::a6]:43546
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:40285

Show key headers only | View raw


hi guys

i typed the following program:

class ball:
    def _init_(self, color, size, direction):
        self.color = color
        self.size = size
        self.direction = direction

    def _str_(self):
        msg = 'hi, i am a ' + self.size + ' ' + self.color + 'ball!'
        return msg

myball = ball('red', 'small', 'down')
print my ball

BUT I GOT THIS ERROR:

Traceback (most recent call last):
  File "/Users/leonardo/Documents/ball2.py", line 11, in <module>
    myball = ball('red', 'small', 'down')
TypeError: this constructor takes no arguments

can you kindly tell me what is wrong?
thanks a lot!

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

need for help leonardo selmi <l.selmi@icloud.com> - 2013-03-01 19:35 +0100
  Re: need for help Alister <alister.ware@ntlworld.com> - 2013-03-01 22:01 +0000
  Re: need for help Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-01 14:59 -0800

csiph-web