On 02/07/13 06:41, Jack Little wrote:
In my concept, when the player buys a boost, their karma (a global) is
multiplied by 25% when added to. How would I do this?
karma = karma * 0.25
which can be written as:
karma *= 0.25
If this is inside a function (as it should be!) you will need to ind
On 07/01/2013 04:41 PM, Jack Little wrote:
In my concept, when the player buys a boost, their karma (a global) is
multiplied by 25% when added to. How would I do this?
Making a changeable global is almost certainly a mistake.
But to multiply by 25%, you simply divide by 4.
karma /= 4
--
In my concept, when the player buys a boost, their karma (a global) is
multiplied by 25% when added to. How would I do this?
Thanks.___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/lis
Many thanks, everyone. Great answers. I decided to read the manual
properly. May take some time but well worth it.
On Mon, Jul 1, 2013 at 2:40 PM, Steven D'Aprano wrote:
> On 01/07/13 19:58, John Steedman wrote:
>
>> Good morning all,
>>
>> A question that I am unsure about. I THINK I have t
On 07/01/2013 12:26 PM, jhame...@medford.k12.ma.us wrote:
Hello,
Can anyone tell me how to remove myself from this mailing list? When I
click on unsubscribe my browser displays a message that I can not access
the unsubscribe url or server because my IP is on a blacklist at
Spamhaus. I am writing
On 01/07/13 19:58, John Steedman wrote:
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
if my_object in my_sequence:
...
Others have already answered this, but for completion, it is testing wheth
On 01/07/13 22:15, Oscar Benjamin wrote:
On 1 July 2013 12:01, Dave Angel wrote:
Third if my_object is something that doesn't equal anything else, such as a
floating point NAN. Two NANs are not equal, and a NAN is not even equal to
itself.
Many builtin collection types do an identity 'is' ch
On Mon, Jul 1, 2013 at 1:01 PM, Dave Angel wrote:
> On 07/01/2013 05:58 AM, John Steedman wrote:
>
>>
>> I believe that "my_sequence" might be a either container class or a
>> sequence type. An effective __hash__ function would be required for each
>> "my_object".
>>
>
> "in" doesn't care if ther
On 07/01/2013 05:58 AM, John Steedman wrote:
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
if my_object in my_sequence:
...
We can be sure what 'if' and 'in' mean, but not the other two items.
Good morning all,
A question that I am unsure about. I THINK I have the basics, but I am not
sure and remain curious.
1. What does this mean?
>>> if my_object in my_sequence:
...
2. What can go wrong with this? What should a code review pick up on?
I believe that "my_sequence" might be a eithe
10 matches
Mail list logo