On 23/10/2013 03:25, Corinne Landers wrote:
> -->
> Hi guys, I
> need a bit of help. I'm writing a class, and in the main
> function I'm trying to say if this method gets called, do
> this. I'm trying things
> like:program = AnimalClass(x,y,z)for i
> in range(x): for j in range(y):
>
On 23 October 2013 08:25, Corinne Landers wrote:
> Hi guys,
Hi Corrine,
> I need a bit of help.
> I'm writing a class, and in the main function I'm trying to say if this
> method gets called, do this.
> I'm trying things like:
>
> program = AnimalClass(x,y,z)
> for i in range(x):
>for j in r
On 23/10/13 08:25, Corinne Landers wrote:
Hi guys,
I need a bit of help.
I'm writing a class, and in the main function I'm trying to say if this
method gets called, do this.
What you are actually doing is "if the method returns
a truth-like value do this." Not quite the same thing,
but much ea
On 23 October 2013 08:58, Albert-Jan Roskam wrote:
> So the built-in 'len()' is *really* a function, but calls to len()
> implemented by __len__ are method calls *disguised* as function calls? I
> sometimes find it easier to write calls to special methods the "normal" way,
> e.g. instead of "
Hi guys,
I need a bit of help. I'm writing a class, and in the main function I'm trying
to say if this method gets called, do this. I'm trying things like:
program = AnimalClass(x,y,z)for i in range(x): for j in range(y): for k
in range(z): animal = program.animal() if animal:
On Wed, 10/23/13, Steven D'Aprano wrote:
Subject: Re: [Tutor] Beginner Question
To: tutor@python.org
Date: Wednesday, October 23, 2013, 5:27 AM
On Tue, Oct 22, 2013 at 04:25:59PM
+0200, Sven Hennig wrote:
> Hello, I would like to
On Tue, Oct 22, 2013 at 04:25:59PM +0200, Sven Hennig wrote:
> Hello, I would like to learn a programming language and have decided to use
> Python. I have some programming experience and doing well in Python. What
> really causes me problems is OOP.
> I'm just dont get it... I'm missing a really
On 22/10/13 19:18, Sven Hennig wrote:
Thank you! You guys helped me out alot.
@Alan your website is great! Really clearly written. Especially the
"Things to remember" part.
Glad you like it. Someday (soon!) I'll get round to finishing
the v3 version... So much to do, so little time!
If you h
Thank you! You guys helped me out alot.
@Alan your website is great! Really clearly written. Especially the "Things
to remember" part.
If you have exercises for me or have a Website with exercises, bring it on. I
think this is the best way to learn.
2013/10/22 Dave Angel
> On 22/10/2013 10:2
On 22/10/2013 10:25, Sven Hennig wrote:
> Hello, I would like to learn a programming language and have decided to use
> Python. I have some programming experience and doing well in Python. What
> really causes me problems is OOP.
> I'm just dont get it... I'm missing a really Practical example. I
On Tue, Oct 22, 2013 at 10:25 AM, Sven Hennig wrote:
> Hello, I would like to learn a programming language and have decided to
> use Python. I have some programming experience and doing well in Python.
> What really causes me problems is OOP.
> I'm just dont get it... I'm missing a really Practica
On 22/10/13 15:25, Sven Hennig wrote:
Hello, I would like to learn a programming language and have decided to
use Python. I have some programming experience and doing well in Python.
What really causes me problems is OOP.
Don't worry this is common.
The problem with OOP is that it only really b
Hello, I would like to learn a programming language and have decided to use
Python. I have some programming experience and doing well in Python. What
really causes me problems is OOP.
I'm just dont get it... I'm missing a really Practical example. In every
book I've read are the examples of such C
>But in the code there is a flaw. input() will evaluate your user input.
i.e. If you give an integer >expression it will tell the answer. And when
you provide a number it will take it as int type. See >below.
Hi,
Ignore my above statements if using Python 3. Sorry my bad. Had a doubt and
went to
>def checkCave(chosenCave):
> print('You approach the cave...')
>time.sleep(2)
> print('It is dark and spooky...')
> time.sleep(2)
>print('A large dragon jumps out in front of you! He opens his jaws
and...')
>print()
> time.sleep(2)
>friendlyCave = random.randint(1, 2)
>
On 12 August 2013 02:14, Karim Liateni wrote:
> 5ÿt5ÿ6hhhyyyfrrtr
>
> eschneide...@comcast.net a écrit :
>
> >I've been learning python from the website 'inventwithpython.com', and
> I'm on a chapter that covers the following code:
>
Just a quick note - not on the algorithm itself. If you run th
On 10 Aug 2013, at 04:30, eschneide...@comcast.net wrote:
> I've been learning python from the website 'inventwithpython.com', and I'm on
> a chapter that covers the following code:
>
> import random
> import time
> def displayIntro():
> print('You are in a land full of dragons. In front of yo
On 10/08/13 04:30, eschneide...@comcast.net wrote:
I've been learning python from the website 'inventwithpython.com', and
I'm on a chapter that covers the following code:
import random
import time
def displayIntro():
print('You are in a land full of dragons. In front of you,')
print('you
I've been learning python from the website 'inventwithpython.com', and I'm on a
chapter that covers the following code:
import random
import time
def displayIntro():
print('You are in a land full of dragons. In front of you,')
print('you see two caves. In one cave, the dragon is friendly')
Mayo Adams wrote:
When writing a simple for loop like so:
for x in f
where f is the name of a file object, how does Python "know" to interpret
the variable x as a line of text, rather than,say, an individual character
in the file? Does it automatically
treat text files as sequences of line
Steve Willoughby wrote:
> On 01-Nov-11 08:34, Mayo Adams wrote:
>> When writing a simple for loop like so:
>>
>> for x in f
>>
>> where f is the name of a file object, how does Python "know" to interpret
>> the variable x as a line of text, rather than,say, an individual
>> character in the
On 01-Nov-11 08:34, Mayo Adams wrote:
When writing a simple for loop like so:
for x in f
where f is the name of a file object, how does Python "know" to interpret
the variable x as a line of text, rather than,say, an individual
character in the file? Does it automatically
treat text files
When writing a simple for loop like so:
for x in f
where f is the name of a file object, how does Python "know" to interpret
the variable x as a line of text, rather than,say, an individual character
in the file? Does it automatically
treat text files as sequences of lines?
--
Mayo Adams
* Ismael Garrido <[EMAIL PROTECTED]> [2006-06-18 19:34]:
> Alan Gauld wrote:
> >> Also, does anyone know of a PDA that would run python?
> >>
> >
> > There was a project called pippy, but I haven't heard anything of it
> > recently so I don't know if its still around or if it runs on modern
> Also, does anyone know of a PDA that would run python?
Some of the new Nokias run python: http://www.forum.nokia.com/python
--
John.
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
n, 18 Jun 2006 05:58:38 -0500
>From: "Bill Tatum" <[EMAIL PROTECTED]>>Subject: [Tutor] Beginner question(s)>To: <tutor@python.org>>Message-ID: <
[EMAIL PROTECTED]>>Content-Type: text/plain; charset="us-ascii">>Hi,>>>>I'm work
Alan Gauld wrote:
>> Also, does anyone know of a PDA that would run python?
>>
>
> There was a project called pippy, but I haven't heard anything of it
> recently so I don't know if its still around or if it runs on modern
> PDAs - I think it was PalmOS anyhow...
>
>
Pippy is quite dea
> message = raw_input("Enter your message:")
> for i in range(len(message)-1,-1, -1):
>print i,
>
> but I just get the numeric values of the string. Can anyone help?
As an alternative approach consider converting to a list and
using the reverse method...
> Also, does anyone know of a PDA t
age: 1
>Date: Sun, 18 Jun 2006 05:58:38 -0500
>From: "Bill Tatum" <[EMAIL PROTECTED]>
>Subject: [Tutor] Beginner question(s)
>To:
>Message-ID: <[EMAIL PROTECTED]>
>Content-Type: text/plain; charset="us-ascii"
>
>Hi,
>
>
>
>I&
On Sun, 2006-06-18 at 05:58 -0500, Bill Tatum wrote:
> Hi,
>
>
>
> I’m working through Python Programming for the Absolute Beginner. One
> of the challenges at the end of chapter 4 is to get a message from the
> user and then print it out backwards. I have…
>
>
>
> message = raw_input("Ent
Hi,
I’m working through Python Programming for the
Absolute Beginner. One of the challenges at the end of chapter 4 is to
get a message from the user and then print it out backwards. I have…
message = raw_input("Enter your message:")
count = len(message)
print count
which giv
> > ..which is not what I'm aiming for. Maybe I'll have to follow Bob's
> > advice and just store all of the variable assignments in a function,
> > and then call the function every time I change one of the variables
> > (based on user input). I could still leave the higher-order variables
> > as f
> I tried redefining the "higher-order" variables as functions, but it
> didn't quite work. Here's a simplified example:
>
>
> var1 = 2
>
> def timestwo(x):
> return x*2
>
> var2 = timestwo(var1)
> print var1, var2
> var1 = 3
> print var1, var2
Try:
##
print 2, timestwo(2)
print 3, times
> From: Jesse <[EMAIL PROTECTED]>
>
> I tried redefining the "higher-order" variables as functions, but it didn't
> quite work. Here's a simplified example:
>
>
> var1 = 2
>
> def timestwo(x):
> return x*2
>
>
> var2 = timestwo(var1)
> print var1, var2
> var1 = 3
> print var1, var2
>
> T
Others have provided workarounds I'll attempt to answer the
rationale part...
> Why is it that when one variable is assigned a value in terms of another
> variable, assigning a new value to the first doesn't change the value of
> the
> second?
Python variables are just names that refer to a valu
-- Forwarded message --
Date: Fri, 7 Apr 2006 21:05:33 -0600
From: Jesse <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Beginner question (variables, namespaces...)
I tried redefining the "higher-order" variables as functions, bu
> > buy_containers = roundup(need/container)
>
>
> Yeah, rather than code these as explicit variables, I'd strongly recommend
> rewriting each of these as functions. Concretely:
>
> def buy_containers(stock, weekly_quota, container):
> return roundup(need(stock, weekly_quota) - extra(stock,
Jesse wrote:
> Why is it that when one variable is assigned a value in terms of
> another variable, assigning a new value to the first doesn't change
> the value of the second? This is giving me a huge headache, since I
> have a bunch of variables defined in terms of one another, and I want
> t
On Fri, 7 Apr 2006, Jesse wrote:
> Why is it that when one variable is assigned a value in terms of another
> variable, assigning a new value to the first doesn't change the value of
> the second?
Hi Jesse,
If you have a "variable" that depends on the values of other parameters,
that's just be
Why is it that when one variable is assigned a value in terms of another variable, assigning a new value to the first doesn't change the value of the second? This is giving me a huge headache, since I have a bunch of variables defined in terms of one another, and I want to be able to dynamically up
40 matches
Mail list logo