On Monday, March 4, 2013 4:37:11 PM UTC, Ian wrote:
> On Mon, Mar 4, 2013 at 7:34 AM, Bryan Devaney wrote:
>
> >> if character not in lettersGuessed:
>
> >>
>
> >> return True
>
> >>
>
> >> return False
>
> >
>
> > assuming a function is being used to pass each letter of the
El 04/03/13 09:18, newtopython escribió:
Hi all,
I'm super new to python, just fyi.
In the piece of code below, secretWord is a string and lettersGuessed is a
list. I'm trying to find out if ALL the characters of secretWord are included
in lettersGuessed, even if there are additional values i
On Mon, Mar 4, 2013 at 7:34 AM, Bryan Devaney wrote:
>> 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
On Monday, March 4, 2013 6:18:20 AM UTC-6, newtopython wrote:
[Note: Post has be logically re-arranged for your comprehensive pleasures]
> for character in secretWord:
> if character not in lettersGuessed:
> return True
> return False
>
> What this code is doing is only checking
> 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 need
On 03/04/2013 07:18 AM, newtopython wrote:
Hi all,
I'm super new to python, just fyi.
Welcome to the Python list.
In the piece of code below, secretWord is a string and lettersGuessed is a
list. I'm trying to find out if ALL the characters of secretWord are included
in lettersGuessed, eve
On Mon, Mar 4, 2013 at 7:18 AM, newtopython wrote:
> Hi all,
>
> I'm super new to python, just fyi.
>
Welcome. Next time write a better subject line, and be sure the code you
post is actually the code you are running. Provide the results you want
and what you get. Provide the traceback if the
In fact this code is already doing what you want, but if the second
character, by example, is not in secrectWord it'll jump out of the for and
return. If you want that interact through the all characters and maybe
count how many them are in the secrectWord, just take of the return there
or do some
Hi all,
I'm super new to python, just fyi.
In the piece of code below, secretWord is a string and lettersGuessed is a
list. I'm trying to find out if ALL the characters of secretWord are included
in lettersGuessed, even if there are additional values in the lettersGuessed
list that aren't in s
On Friday, January 4, 2013 11:18:24 AM UTC+5:30, Steven D'Aprano wrote:
> On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote:
>
>
>
> > Dear Group,
>
> > If I take a list like the following:
>
> >
>
> > fruits = ['banana', 'apple', 'mango']
>
> > for fruit in fruits:
>
> >print
On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote:
> Dear Group,
> If I take a list like the following:
>
> fruits = ['banana', 'apple', 'mango']
> for fruit in fruits:
>print 'Current fruit :', fruit
>
> Now,
> if I want variables like var1,var2,var3 be assigned to them, we may
> ta
On Thu, 03 Jan 2013 12:04:03 -0800, subhabangalore wrote:
> Dear Group,
> If I take a list like the following:
>
> fruits = ['banana', 'apple', 'mango']
> for fruit in fruits:
>print 'Current fruit :', fruit
>
> Now,
> if I want variables like var1,var2,var3 be assigned to them, we may
> t
On Jan 4, 6:04 am, subhabangal...@gmail.com wrote:
> but can we do something to assign the variables dynamically I was thinking
> of
> var_series=['var1','var2','var3']
> for var in var_series:
> for fruit in fruits:
> print var,fruits
Before trying to do this, write the next bit of code
I'm interested to know why you're trying this as well. Is this something that
would be helped by creating a class and then dynamically creating instances of
that class? Something like...
class Fruit:
def __init__(self, name):
self.name = name
for fruit in ['banana', 'apple', 'mang
Yeah, this seems like a bad idea. What exactly are you trying to do here?
Maybe using a dictionary is what you want?
d = {
'first' : 'banana',
'second' : 'apple',
'third' : 'mango'
}
for key, value in d.items():
print key, value
However I'm still not sure why you'd want to d
subhabangal...@gmail.com wrote:
> Dear Group,
> If I take a list like the following:
>
> fruits = ['banana', 'apple', 'mango']
> for fruit in fruits:
>print 'Current fruit :', fruit
>
> Now,
> if I want variables like var1,var2,var3 be assigned to them, we may take,
> var1=banana,
> var2=ap
On 2013-01-03 20:04, subhabangal...@gmail.com wrote:
Dear Group,
If I take a list like the following:
fruits = ['banana', 'apple', 'mango']
for fruit in fruits:
print 'Current fruit :', fruit
Now,
if I want variables like var1,var2,var3 be assigned to them, we may take,
var1=banana,
var2=a
Dear Group,
If I take a list like the following:
fruits = ['banana', 'apple', 'mango']
for fruit in fruits:
print 'Current fruit :', fruit
Now,
if I want variables like var1,var2,var3 be assigned to them, we may take,
var1=banana,
var2=apple,
var3=mango
but can we do something to as
18 matches
Mail list logo