Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emasatsugu python bootcamp #10

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Conversation

emasatsugu
Copy link

No description provided.

@emasatsugu
Copy link
Author

DONE!


def size(dictionary):
"""
Returns the number of words in the English `dictionary`.
"""
pass
return len(list(dictionary))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to transform dictionary into a list! you can just call len(dictionary)


# PROB 2
# Return the sum of all the numbers in lst. If lst is empty, return 0.
def sum_list(lst):
return 0
sum = 0
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return sum(lst)

@kennyyu
Copy link
Collaborator

kennyyu commented Nov 18, 2013

python has lots of built-in functions! http://docs.python.org/2/library/functions.html

(e.g. sum, sorted, max, min, ...) Learning how to use these effectively will make your code look better, simpler, and more "python"-ic!

@emasatsugu
Copy link
Author

Oh wow I'm doing way too much work. Okay I'll take a look at that website
thanks!

On Monday, November 18, 2013, Kenny Yu wrote:

python has lots of built-in functions!
http://docs.python.org/2/library/functions.html

(e.g. sum, sorted, max, min, ...) Learning how to use these effectively
will make your code look better, simpler, and more "python"-ic!


Reply to this email directly or view it on GitHubhttps://github.com//pull/10#issuecomment-28677529
.

vowels = ['a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U']
for letter in s:
if letter in vowels:
news = news.replace(letter, "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to have the 'for letter in s' loop--just loop over vowels and remove them from s!

@kennyyu
Copy link
Collaborator

kennyyu commented Nov 19, 2013

woooooo you finished! awesome use of git!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants