Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Hi fellow OCW students,
I have a question about the Hangman game homework. http://pastebin.com/2mhjAqZC
here is my function for checking if there's more guesses to go. What it does is that it goes through every string in 'inter' to see if there's '_' . So, if there's none of them, it means you've guessed everything and you won. However, my question is that my code seems to be too long. Are there more efficient ways to check if there's a specific character that I'm looking for in my string.
 one year ago
 one year ago
Hi fellow OCW students, I have a question about the Hangman game homework. http://pastebin.com/2mhjAqZC here is my function for checking if there's more guesses to go. What it does is that it goes through every string in 'inter' to see if there's '_' . So, if there's none of them, it means you've guessed everything and you won. However, my question is that my code seems to be too long. Are there more efficient ways to check if there's a specific character that I'm looking for in my string.
 one year ago
 one year ago

This Question is Closed

MicroBotBest ResponseYou've already chosen the best response.1
if something in somethingelse: do this
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
'inter' is the string of your guesses on a word. So, it changes from '_ _ _ _ ' to something like '_ _ s _"
 one year ago

MicroBotBest ResponseYou've already chosen the best response.1
or if '_' not in word: etc etc
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
woops! that simple! Thanks!
 one year ago

MicroBotBest ResponseYou've already chosen the best response.1
let me know if it works
 one year ago

LoveMathFermatBest ResponseYou've already chosen the best response.0
Yes! it works! Thanks MicroBot
 one year ago
See more questions >>>
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.