Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

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.

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
if something in somethingelse: do this
'inter' is the string of your guesses on a word. So, it changes from '_ _ _ _ ' to something like '_ _ s _"
or if '_' not in word: etc etc

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

woops! that simple! Thanks!
let me know if it works
Yes! it works! Thanks MicroBot

Not the answer you are looking for?

Search for more explanations.

Ask your own question