A community for students.
Here's the question you clicked on:
 0 viewing
susanjrobertson
 2 years ago
I've gotten the pig latin question in week 4, but am having problems with the Report Card GPA and the 2nd and 3rd List comprehension  has anyone done these yet? Any hints?
susanjrobertson
 2 years ago
I've gotten the pig latin question in week 4, but am having problems with the Report Card GPA and the 2nd and 3rd List comprehension  has anyone done these yet? Any hints?

This Question is Closed

snark
 2 years ago
Best ResponseYou've already chosen the best response.0i think something like: def f(word): # create a list of vowels v = 'aeiouy' # since working on comprehensions... vowels = [v[x] for x in range(len(v))] l = [word[x] for x in range(len(word)) if word[x] in vowels] return l f('the rather slothful brown fox stepped over the line') ['e', 'a', 'e', 'o', 'u', 'o', 'o', 'e', 'e', 'o', 'e', 'e', 'i', 'e'] outcomes = [[x,y] for x in ['h','t'] for y in ['h','t']] print outcomes [['h', 'h'], ['h', 't'], ['t', 'h'], ['t', 't']]

susanjrobertson
 2 years ago
Best ResponseYou've already chosen the best response.0Thanks  I'm getting better with the comprehension lists. I'm still unsure of what to do with the GPA problem, I'll tackle that tomorrow. Appreciate all your help.

Screech
 2 years ago
Best ResponseYou've already chosen the best response.0I'm on the GPA problem also. Like many of the exercises, it is very poorly written. It should have been peer reviewed, and student critiqued. "Could we write the program in a different way" Is this part of the exercise? "There are a couple ways to do this" Really? How about if we find just one? I think the exercise is simpler than it appears once you weed out the confusing verbage.Thats my guess at any rate. I'll know once I finish the exercise.

pdpinch
 2 years ago
Best ResponseYou've already chosen the best response.0What kind of trouble are you having with the GPA problem? I've posted my solution at https://gist.github.com/4051746

susanjrobertson
 2 years ago
Best ResponseYou've already chosen the best response.0Thanks pdpinch  that was helpful. I'm still having trouble with how to approach these, I guess it's just me trying to figure out how to program well  my brain isn't clicking with it as easily as I would like :/
Ask your own question
Sign UpFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.