Hi Guys. Thanks for the responses and assistance.
I came right after-all. The last 2 blocks read the following.
def get_class_average(students):
results = []
for a in students:
b = float(get_average(a))
results.append(b)
return average(results)
students = [lloyd, al
On 22/10/15 10:03, Vusa Moyo wrote:
Hi Guys. Thanks for the responses and assistance.
I came right after-all. The last 2 blocks read the following.
Glad you are happy but there is still something you could improve:
def get_class_average(students):
results = []
for a in students:
Thanks Alan.
Removed that .
=
# Add your functions below!
def average(numbers):
total = sum(numbers)
total = total / len(numbers)
return total
def get_average(student):
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(stude
An additional suggestion:
> =
> # Add your functions below!
> def average(numbers):
> total = sum(numbers)
> total = total / len(numbers)
> return total
Don't re-assign total here. The problem is that conceptually "total" no
longer represents the total in the second assignment.
Hi!!I would like to prepare a dictionary with complex structure:
complex = {name ="value",surname="po",age=poi)
What is the most pythonic way to build a dictionary of dictionary?thanks for
any help!
___
Tutor maillist - Tutor@python.org
On 10/23/2015 05:19 AM, jarod_v6--- via Tutor wrote:
Hi!!I would like to prepare a dictionary with complex structure:
complex = {name ="value",surname="po",age=poi)
What is the most pythonic way to build a dictionary of dictionary?thanks
for any help!
This doesn't look too complex so I am
On 2015-10-22 14:50, Thomas C. Hicks wrote:
On 10/23/2015 05:19 AM, jarod_v6--- via Tutor wrote:
Hi!!I would like to prepare a dictionary with complex structure:
complex = {name ="value",surname="po",age=poi)
What is the most pythonic way to build a dictionary of
dictionary?thanks for any
On 22Oct2015 23:19, jarod...@libero.it wrote:
Hi!!I would like to prepare a dictionary with complex structure:
complex = {name ="value",surname="po",age=poi)
Well, in Python you'd write the above like this:
complex = {'name': "value", 'surname': "po", 'age': poi}
What is the most pythonic
jarod_v6--- via Tutor writes:
> Hi!!I would like to prepare a dictionary with complex structure:
>
> complex = {name ="value",surname="po",age=poi)
That's invalid syntax (the braces don't match) and it seems to use names
from elsewhere.
If you mean a dictionary like this::
wibble = {'name'
On 10/23/2015 05:59 AM, Alex Kleider wrote:
mydict = dict('name'='value', 'surname'='po','age'='poi')
Oops, you are correct! Don't want to put the key names in quotes, I
mistyped my experiment.
SDG,
tom
___
Tutor maillist - Tutor@python.org
To uns
At this point I feel like I am wasting my time by not asking for help. I
can't figure out why the file keeps coming back empty. There are no error
message, just an empy file. Very frustrating.
from BeautifulSoup import BeautifulSoup
import urllib2
import csv
wiki = "https://en.wikipedia.org/wiki/
On Thu, Oct 22, 2015 at 4:01 PM, Cynthia Alice Andrews
wrote:
> At this point I feel like I am wasting my time by not asking for help. I
> can't figure out why the file keeps coming back empty. There are no error
> message, just an empy file. Very frustrating.
Unfortunately, the formatting of yo
On Thu, Oct 22, 2015 at 8:07 PM, Personal wrote:
> I figured it out! Thanks for taking the time to respond!
No problem; glad you found it. :)
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.or
13 matches
Mail list logo