Re: [Tutor] Statistics with python

2018-10-15 Thread Mariam Haji
Hi, I think this makes more sense to me to get the std. I will go with this route since there is a number of age groups and not just 56. Thanks guys for all your help. >>> import numpy >>> ages = [35, 45, 55, 70] >>> numpy.mean(ages) 51.25 >>> numpy.std(ages) 12.93010054098575 On Sun, Oct 14,

Re: [Tutor] what does the forward slash mean in this function signature?

2018-10-15 Thread eryk sun
On Mon, Oct 15, 2018 at 6:00 AM Albert-Jan Roskam wrote: > > In Python 3.6 (Windows) I often see a forward slash in a function signature, > see below. > What does it mean? I vaguely remember reading something about new > possbilities in > python 3, something like "def foo(x, *, y)". Perhaps

[Tutor] what does the forward slash mean in this function signature?

2018-10-15 Thread Albert-Jan Roskam
Hello, In Python 3.6 (Windows) I often see a forward slash in a function signature, see below. What does it mean? I vaguely remember reading something about new possbilities in python 3, something like "def foo(x, *, y)". Perhaps it's related to that? >>> help({}.fromkeys) Help on built-in

Re: [Tutor] python game error

2018-10-15 Thread Peter Otten
Alan Gauld via Tutor wrote: > On 15/10/18 08:57, Peter Otten wrote: > >> By the way, you do not need a map (dict) at all to implement a game like >> this, you may return the next scene directly. A sketch: >> >> class Bridge: >> def enter(self): >> ... >> action = ... >>

Re: [Tutor] python game error

2018-10-15 Thread Alan Gauld via Tutor
On 15/10/18 08:57, Peter Otten wrote: > By the way, you do not need a map (dict) at all to implement a game like > this, you may return the next scene directly. A sketch: > > class Bridge: > def enter(self): > ... > action = ... > if action == "jump off the bridge":

Re: [Tutor] python game error

2018-10-15 Thread Peter Otten
bob gailer wrote: > Python coding "trick"1 > when I build a map I omit the () after the class e.g. 'death' = Death, > ... and apply them to the item retrieved from the map. > > use a decorator to build the map dictionary: > > # the decorator function: > def