Hello! I'm having troubles understanding what is the difference between %s
and %r(format characters). I did google and found something on
StackOverflow but I don't understand the explanation as it's not beginner
orientated.
Also, I have this code from learn python the hard way. Why at line 9 doe
On Sat, Jul 23, 2011 at 7:48 AM, amt <0101...@gmail.com> wrote:
> Hello! I'm having troubles understanding what is the difference between %s
> and %r(format characters). I did google and found something on
> StackOverflow but I don't understand the explanation as it's not beginner
> orientated.
>
On Saturday 23 July 2011 13:48:03 amt wrote:
> Hello! I'm having troubles understanding what is the difference between %s
> and %r(format characters). I did google and found something on
> StackOverflow but I don't understand the explanation as it's not beginner
> orientated.
>
>
> Also, I have th
Hello everybody,
: > Hello! I'm having troubles understanding what is the difference between %s
: > and %r(format characters). I did google and found something on
: > StackOverflow but I don't understand the explanation as it's not beginner
: > orientated.
: >
: >
: > Also, I have this co
I just use string{0}.format(arg) format and that solves needing to memorize
% whatevers.
On Sat, Jul 23, 2011 at 11:08 AM, Martin A. Brown wrote:
>
> Hello everybody,
>
> : > Hello! I'm having troubles understanding what is the difference
> between %s
> : > and %r(format characters). I did goog
On Sat, Jul 23, 2011 at 8:48 AM, amt <0101...@gmail.com> wrote:
> Hello! I'm having troubles understanding what is the difference between %s
> and %r(format characters). I did google and found something on
> StackOverflow but I don't understand the explanation as it's not beginner
> orientated.
>
Thank you for the two explanations. I think I have a good idea of what is
going on now with the arguments and keyword arguments.
My only remaining question is the pad_for_usrp argument. The default value is
True so I thought it was a boolean and couldn't have anything to do with the
"self" that
%s = send object to str() first then drop it into the string
%r = send object to repr() first then drop it into the string
pretty straightforward:
>>> x = 'foo'
>>> str(x)
'foo'
>>> repr(x)
"'foo'"
why do people do %r at all? to get the quotes for free: :-)
>>> x = 'Python'
>>> print "What is t
i forgot to define these:
str() - printable/human-readable string representation of an object
repr() - evaluatable string representation of an object (can "eval()"
it, meaning it is a string representation that evaluates to a Python
object)
in other words:
x = 'foo'
str(x)
> 'foo'
dave wrote:
My only remaining question is the pad_for_usrp argument. The default value is
True so I thought it was a boolean and couldn't have anything to do with the
"self" that was passed to it. However, I can probably puzzle
that out by looking at how it's used in the code.
I thought th
Hello everyone,
How can I make two copies of a dictionary that don't point to the same
location in memory? My plan is to generate d1 and make d2 a copy of d1.
After the user modifies d1 I want him/her to be able to return to the
initial dictionary (d2) values. I tried:
d1 = {values}
d2 = dict(d1)
t
Ryan Strunk wrote:
Hello everyone,
How can I make two copies of a dictionary that don't point to the same
location in memory? My plan is to generate d1 and make d2 a copy of d1.
After the user modifies d1 I want him/her to be able to return to the
initial dictionary (d2) values. I tried:
d1 = {va
Hello All,
I am putting up a simple game .. the game is about manipulation. If the gets
through level one ... I have to change the word with another...
Am I going to destroy level window and build level 2 or is there a way to
just adjust the word (I used labels)
Regards,
Janus
--
*Satajanus N
13 matches
Mail list logo