Re: [Tutor] Python OOP question

2016-04-02 Thread Alan Gauld
On 02/04/16 22:46, Eric Enoch wrote: > of BJ player is ultimately BJ hand. I am now getting an error when calling > a method to add a card to that hand. Below is where the error o Unfortunately you don't show us the actual code where you call that method, nor do you show us the actual error (in f

Re: [Tutor] Python OOP question

2016-04-02 Thread Ben Finney
Eric Enoch writes: > This is my first non-MATLAB programming language so I am having some > trouble with object-oriented programming. Welcome! Thanks for learning Python. > Specifically, I am working on a program that simulates a blackjack > game. It was functioning but I have tried adding some

[Tutor] Python OOP question

2016-04-02 Thread Eric Enoch
This is my first non-MATLAB programming language so I am having some trouble with object-oriented programming. Specifically, I am working on a program that simulates a blackjack game. It was functioning but I have tried adding some new functionality in allowing players to make bets To surmise, BJ

Re: [Tutor] Alan G Week 10 warmup assignment help

2016-04-02 Thread Alan Gauld
On 02/04/16 10:59, Albert-Jan Roskam wrote: >>> however now pylint is returning: >>> task_07.py:36: [W0102(dangerous-default-value), iter_dict_funky_sum] >>> Dangerous default value DATA (__builtin__.dict) as argument >> I would drop the default value for the parameter. >> ( I suspect that Python

Re: [Tutor] Fw: About the Round Function

2016-04-02 Thread Danny Yoo
On Fri, Apr 1, 2016 at 6:13 PM, Ben Finney wrote: > Nacir Bouali writes: > >> My students and I are interested in knowing the rationale behind >> Python's choice of the Banker's rounding algorithm to be the default >> rounding algorithm in the third release of Python. > > Can you provide a link t

Re: [Tutor] Alan G Week 10 warmup assignment help

2016-04-02 Thread Albert-Jan Roskam
> To: tutor@python.org > From: alan.ga...@btinternet.com > Date: Sat, 2 Apr 2016 09:08:04 +0100 > Subject: Re: [Tutor] Alan G Week 10 warmup assignment help > > On 02/04/16 02:21, Daniella Sapozhnikova wrote: > > I changed the file to this: > > > DATA = {2: 7493945, > > 76: 4654320, > .

Re: [Tutor] week 10 synthesizing assignment

2016-04-02 Thread Alan Gauld
On 02/04/16 08:22, Daniella Sapozhnikova wrote: > I have a couple of questions. > 1) If I wanted to combine two dictionaries into one, how would I go about > doing so? (the .update method?) I'm not sure what you mean by that. There are at kleat 2 ways to interpret it. Do you want to merge the data

Re: [Tutor] Alan G Week 10 warmup assignment help

2016-04-02 Thread Alan Gauld
On 02/04/16 02:21, Daniella Sapozhnikova wrote: > I changed the file to this: > DATA = {2: 7493945, > 76: 4654320, ... > 153: 12074784, > 8: 4337229} > > def iter_dict_funky_sum(data=DATA): > funky = 0 > for key, value in data.iteritems(): > funky += value

Re: [Tutor] week 10 synthesizing assignment

2016-04-02 Thread Ben Finney
Daniella Sapozhnikova writes: > 1) If I wanted to combine two dictionaries into one, how would I go > about doing so? How to do it depends on what policy you want to adopt for duplicate keys: * Existing item stays? * New item overrides existing item? * Something else happens? > (the .update

[Tutor] week 10 synthesizing assignment

2016-04-02 Thread Daniella Sapozhnikova
I have a couple of questions. 1) If I wanted to combine two dictionaries into one, how would I go about doing so? (the .update method?) 2) How can I make that combined dictionary have inner dictionaries with the inner values from the previous separate dictionaries? Please point me in the right dir

[Tutor] week 10 warm up assignment

2016-04-02 Thread Daniella Sapozhnikova
I tried changing the file earlier, however it wasn't returning the apropriate value, so the file looks the same as earlier: #!/usr/bin/env python # -*- coding: utf-8 -*- """Task 07: declaring a dictionary, creating a function, return a funky total """ DATA = {2: 7493945, 76: 4654320,

Re: [Tutor] Alan G Week 10 warmup assignment help

2016-04-02 Thread Daniella Sapozhnikova
I changed the file to this: #!/usr/bin/env python # -*- coding: utf-8 -*- """Task 07: declaring a dictionary, creating a function, return a funky total """ DATA = {2: 7493945, 76: 4654320, 3: 4091979, 90: 1824881, 82: 714422, 45: 1137701, 10: 37436