A community for students.
Here's the question you clicked on:
 0 viewing

This Question is Closed

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1does it work?  nope  how many words are in words.txt? available is missing a letter here is another way to remove a character from a string  http://dpaste.com/776965/

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0Fixed the missing 'w': http://dpaste.com/776970/ Yes it works. This is the word.txt file.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1when i run it, it only loads one word from the file.

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0That part was given. Students just have to code below ''your code begins here''. You just need a one random word each time you play Hangman.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1when you run it, it works? well, load_words is not working, you need to fix it before the game will work. it only loads the first word in the file.

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0load_works was written by the TA's as it was give with the problem handout. When I run load_words I get 55900 words.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1ahh, nevermind  i had the file from the 2008 class

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0So does the code work? Except the remove character solution (yours is simpler), do you have any comments on sections that could be improved?

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1the enumerate() function is convenient when you need to iterate over the items and the indices of a sequence  http://dpaste.com/776981/

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0Where can I use that?

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1I was looking at format_word() when i thought of that.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1i like to use lists because they have lots of useful methods. I might have kept the word as a list of characters and worked with that instead of slices. For some reason, i never think about using slices.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1otherwise looks good to me

David_Novo
 3 years ago
Best ResponseYou've already chosen the best response.0Using lists instead of slices really seems a great idea. It's way more easy to work with lists than with strings. Thanks for the tip.

bwCA
 3 years ago
Best ResponseYou've already chosen the best response.1i'm thinking though (and remembering) that slices can be very powerful  i need to start remembering to consider them as an option.
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.