In the following excerpt from a program in the book I am following:
print "If I add %d, %d, and %d I get %d." % (
my_age, my_height, my_weight, my_age + my_height + my_weight)
is
% (
my_age, my_height, my_weight, my_age + my_height + my_weight)
the/a format string?
If not, th
On Sun, Jun 26, 2011 at 12:05 PM, Lisi wrote:
> In the following excerpt from a program in the book I am following:
>
> print "If I add %d, %d, and %d I get %d." % (
> my_age, my_height, my_weight, my_age + my_height + my_weight)
>
> is
>
> % (
> my_age, my_height, my_weight, my_age +
Lisi wrote:
In the following excerpt from a program in the book I am following:
print "If I add %d, %d, and %d I get %d." % (
my_age, my_height, my_weight, my_age + my_height + my_weight)
is
% (
my_age, my_height, my_weight, my_age + my_height + my_weight)
the/a format str
Thanks, Noah and Steven. :-)
On Sunday 26 June 2011 12:24:12 Steven D'Aprano wrote:
> Lisi wrote:
> > In the following excerpt from a program in the book I am following:
> >
> >print "If I add %d, %d, and %d I get %d." % (
> > my_age, my_height, my_weight, my_age + my_height + my_weight
On Sun, Jun 26, 2011 at 2:42 PM, Lisi wrote:
> Thanks, Noah and Steven. :-)
>
> On Sunday 26 June 2011 12:24:12 Steven D'Aprano wrote:
>> Lisi wrote:
>> > In the following excerpt from a program in the book I am following:
>> >
>> > print "If I add %d, %d, and %d I get %d." % (
>> > my_a
On Sun, Jun 26, 2011 at 2:02 AM, Vincent Balmori
wrote:
>
> It's working better now. The problem I have left is that I have to set the
> channel and volume values in a range (for both I intend for 0-10). I thought
> the range() would be the choice, but probably I'm not using it right.
I think the
"Lisi" wrote
So, if I have now understood correctly, a format string is a string
containing
at least one variable, and the variable(s) is/are preceded by the %
symbol.
Yes???
Umm, nearly...
The format string contains format specifiers. They are not variables.
The specifiers define the type
On Sunday 26 June 2011 17:15:14 Alan Gauld wrote:
> "Lisi" wrote
> Umm, nearly...
> The format string contains format specifiers. They are not variables.
> The specifiers define the type of data to be inserted into the string
> as well as how the data will be formatted - hence the name.
>
> So you
I made in elif statement for the channel changer that works for it, but the
volume systems system boundary does not the way I want it to. If the volume
is 2 and I lower it by a value of 5, it will accept the volume at a negative
number thus going past the boundary. The vice-versa for the high boun
On Sun, Jun 26, 2011 at 8:28 PM, Vincent Balmori
wrote:
>
> I made in elif statement for the channel changer that works for it, but the
> volume systems system boundary does not the way I want it to. If the volume
> is 2 and I lower it by a value of 5, it will accept the volume at a negative
> num
I'm on the Critter Caretake problem that involves handling more than one
critter. I have looked At David Merrick's threads for some answers, but the
difference is that he created a whole new class to handle it, while I only
made more critter objects. The only problem I have left is to have my
acti
Is it possible too have
crit1 = Critter("Dave")
crit2 = Critter("Sweetie")
farm = [crit1,crit2] #List#
and then be able to use Critters methods on farm?
# Critter Caretaker
# A virtual pet to care for
class Critter(object):
"""A virtual pet"""
def __init__(self, name, hunger = 0, bore
On Sun, Jun 26, 2011 at 7:12 PM, David Merrick wrote:
> Is it possible too have
>
> crit1 = Critter("Dave")
> crit2 = Critter("Sweetie")
> farm = [crit1,crit2] #List#
>
> and then be able to use Critters methods on farm?
>
> No. farm is a list, and lists don't inherit the methods of the objects
13 matches
Mail list logo