Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #40448

Re: Question on for loop

Newsgroups comp.lang.python
Date 2013-03-04 06:34 -0800
References <d5f0feb6-533a-445b-a89a-8113c1668e9d@googlegroups.com>
Message-ID <7345f1f5-d958-4fef-ad50-81fb526b4f2f@googlegroups.com> (permalink)
Subject Re: Question on for loop
From Bryan Devaney <bryan.devaney@gmail.com>

Show all headers | View raw


>         if character not in lettersGuessed:
> 
>         return True
> 
> return False

assuming a function is being used to pass each letter of the letters guessed inside a loop itself that only continues checking if true is returned, then that could work.

It is however more work than is needed. 

If you made secretword a list,you could just 

set(secretword)&set(lettersguessed) 

and check the result is equal to secretword.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Question on for loop newtopython <roshen.sethna@gmail.com> - 2013-03-04 04:18 -0800
  Re: Question on for loop leo kirotawa <kirotawa@gmail.com> - 2013-03-04 09:59 -0300
  Re: Question on for loop Joel Goldstick <joel.goldstick@gmail.com> - 2013-03-04 08:04 -0500
  Re: Question on for loop Dave Angel <davea@davea.name> - 2013-03-04 08:36 -0500
  Re: Question on for loop Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-04 06:34 -0800
    Re: Question on for loop Ian Kelly <ian.g.kelly@gmail.com> - 2013-03-04 09:37 -0700
      Re: Question on for loop Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-05 03:12 -0800
      Re: Question on for loop Bryan Devaney <bryan.devaney@gmail.com> - 2013-03-05 03:12 -0800
  Re: Question on for loop Rick Johnson <rantingrickjohnson@gmail.com> - 2013-03-04 07:41 -0800
  Re: Question on for loop Ricardo Aráoz <ricaraoz@gmail.com> - 2013-03-04 10:21 -0300

csiph-web