Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #52436
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <python@mrabarnett.plus.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.008 |
| X-Spam-Evidence | '*H*': 0.98; '*S*': 0.00; 'attribute': 0.07; 'class,': 0.07; '__init__': 0.09; 'instance.': 0.09; 'works.': 0.09; 'def': 0.12; 'random': 0.14; 'called.': 0.16; 'class:': 0.16; 'from:addr:mrabarnett.plus.com': 0.16; 'from:addr:python': 0.16; 'from:name:mrab': 0.16; 'instance:': 0.16; 'kris': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.93': 0.16; 'received:84.93.230': 0.16; 'repetition': 0.16; 'wrote:': 0.18; 'working.': 0.19; 'seems': 0.21; 'import': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'header:In-Reply-To:1': 0.27; 'tried': 0.27; 'point': 0.28; "doesn't": 0.30; 'sets': 0.30; 'statement': 0.30; 'prints': 0.31; 'class': 0.32; 'there.': 0.32; 'sense': 0.34; 'skip:_ 10': 0.34; 'subject:with': 0.35; "can't": 0.35; 'classes': 0.35; 'received:84': 0.35; 'but': 0.35; 'there': 0.35; 'crazy': 0.36; 'method': 0.36; 'should': 0.36; 'to:addr :python-list': 0.38; 'anything': 0.39; 'does': 0.39; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'subject:back': 0.60; 'numbers': 0.61; 'subject:more': 0.64; 'between': 0.67; 'header:Reply-To:1': 0.67; 'atm': 0.68; 'reply-to:no real name:2**0': 0.71; '10:': 0.84; 'frustrating': 0.84; 'reply-to:addr:python.org': 0.84 |
| X-CM-Score | 0.00 |
| X-CNFS-Analysis | v=2.1 cv=ZMDuxxLb c=1 sm=1 tr=0 a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=0Bzu9jTXAAAA:8 a=0kkAYlmtguIA:10 a=ihvODaAuJD4A:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=EBOSESyhAAAA:8 a=8AHkEIZyAAAA:8 a=NnfSt9Y7ZA4A:10 a=Uzh8gwdv3Pazvh1Pq5EA:9 a=wPNLvfGTeEIA:10 |
| X-AUTH | mrabarnett:2500 |
| Date | Tue, 13 Aug 2013 04:31:15 +0100 |
| From | MRAB <python@mrabarnett.plus.com> |
| User-Agent | Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: back with more issues |
| References | <cc701481-0ecd-411b-8473-0596b4252949@googlegroups.com> <mailman.493.1376286900.1251.python-list@python.org> <kuat2n$msi$1@dont-email.me> <mailman.509.1376337204.1251.python-list@python.org> <88f95aab-0274-48ee-a68a-14a8c3b36e9c@googlegroups.com> |
| In-Reply-To | <88f95aab-0274-48ee-a68a-14a8c3b36e9c@googlegroups.com> |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | python-list@python.org |
| 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.518.1376364680.1251.python-list@python.org> (permalink) |
| Lines | 37 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1376364680 news.xs4all.nl 15871 [2001:888:2000:d::a6]:39342 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:52436 |
Show key headers only | View raw
On 13/08/2013 04:13, Kris Mesenbrink wrote: > the Classes and __init__ still don't make much sense actually. i have tried and tried again to make it generate numbers between 0 and 5 in a while statement but it just doesn't seem to be working. > > import random > > > class Player(): This sets an attribute of the class: > hp = 10 This method will be called to initialise an instance of the class when one is created: > def __init__(self, patt): This sets an attribute of the instance: > self.att = random.randint(0,5) > > > > while Player.hp == 10: This prints the __init__ method of the class: > print (Player.__init__) > > atm it seems to be printing "<function Player.__init__ at 0x0000000002954EA0>" over and over again, i don't mind the repetition but from my understanding there should be numbers there. numbers that change. crazy frustrating that i just don't understand how this works. > At no point does it create an instance of the class, so the __init__ method is never called. You can't return anything from the __init__ method because it's called just to initialise the instance.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
back with more issues Kris Mesenbrink <krismesenbrink@gmail.com> - 2013-08-11 20:33 -0700
Re: back with more issues Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 00:21 -0400
Re: back with more issues Kris Mesenbrink <krismesenbrink@gmail.com> - 2013-08-11 21:35 -0700
Re: back with more issues Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-12 00:51 -0400
Re: back with more issues Dave Angel <davea@davea.name> - 2013-08-12 05:54 +0000
Re: back with more issues Kris Mesenbrink <krismesenbrink@gmail.com> - 2013-08-11 23:31 -0700
Re: back with more issues Kris Mesenbrink <krismesenbrink@gmail.com> - 2013-08-11 23:57 -0700
Re: back with more issues Dave Angel <davea@davea.name> - 2013-08-12 07:11 +0000
Re: back with more issues Rotwang <sg552@hotmail.co.uk> - 2013-08-12 15:56 +0100
Re: back with more issues random832@fastmail.us - 2013-08-12 15:46 -0400
Re: back with more issues Kris Mesenbrink <krismesenbrink@gmail.com> - 2013-08-12 20:13 -0700
Re: back with more issues MRAB <python@mrabarnett.plus.com> - 2013-08-13 04:31 +0100
Re: back with more issues Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-08-12 23:48 -0400
Re: back with more issues Steven D'Aprano <steve@pearwood.info> - 2013-08-13 06:22 +0000
csiph-web