On Tue, Jul 5, 2011 at 3:23 PM, Martin A. Brown wrote:
> I have heard people express frustration many times about how a
> program(ming language) or "the computer" did not understand
> something because the thing was 'missing a damned semicolon'.
>
> Unfortunately, these syntactical rules are quit
Válas Péter wrote:
So the trick is to define the dictionary in separate sessions, not at once.
No.
value = 42
my_dict = {'a': value, 'b': value, 'c': 23, 'd': value, 'e': 97}
will work fine too.
--
Steven
___
Tutor maillist - Tutor@python.org
Hello,
: I am copy-typing the following pre-written program:
:
: def break_words(stuff):
: """This function will break up words for us."""
: words=stuff.split(' ')
: return words
:
: def sort_words(words):
: """Sorts the words."""
: return sorted(words)
:
:
I am copy-typing the following pre-written program:
def break_words(stuff):
"""This function will break up words for us."""
words=stuff.split(' ')
return words
def sort_words(words):
"""Sorts the words."""
return sorted(words)
def print_first_word(words):
"""Prints th
On Tue, Jul 5, 2011 at 3:40 PM, Walter Prins wrote:
>> So the trick is to define the dictionary in separate sessions, not at
>> once.
>
> What do you mean, "seperate sessions, not at once"?
He means you can't say:
d = {a: "1", b: d["a"]}
Which is correct. To set one value based on another they
Hi,
7/5 Válas Péter
> So the trick is to define the dictionary in separate sessions, not at once.
>
What do you mean, "seperate sessions, not at once"?
W
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://ma
So the trick is to define the dictionary in separate sessions, not at once.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor
"Válas Péter" wrote
I have a dictionary with the keys 'a' and 'b'. It is not in a class.
May I use the value of 'a' when defining the value of 'b'?
If so, what is the syntax?
single = {'a': 1,
'b': 2
}
double = { 'a': single['a'] *2,
'b' : singl
Válas Péter wrote:
> I have a dictionary with the keys 'a' and 'b'. It is not in a class. (I
> know that everything is in a class, but not explicitly.)
> May I use the value of 'a' when defining the value of 'b'? If so, what is
> the syntax?
>>> d = {}
>>> d["a"] = 1
>>> d["b"] = d["a"] + 1
>>> d
2011/7/5 Válas Péter :
> Hi,
>
> I have a dictionary with the keys 'a' and 'b'. It is not in a class. (I know
> that everything is in a class, but not explicitly.)
> May I use the value of 'a' when defining the value of 'b'? If so, what is
> the syntax?
Yes. The syntax is the same as anything invo
Hi,
I have a dictionary with the keys 'a' and 'b'. It is not in a class. (I know
that everything is in a class, but not explicitly.)
May I use the value of 'a' when defining the value of 'b'? If so, what is
the syntax?
Thx,
Péter
___
Tutor maillist -
got it , thanks a lot
On Tue, Jul 5, 2011 at 8:18 AM, Adam Bark wrote:
> What Chris is getting at is that you'll use some module, eg pyserial, to
> interface with the serial port. So if you write a little module that has the
> same interface then you can pretend you have a serial port attached de
What Chris is getting at is that you'll use some module, eg pyserial, to
interface with the serial port. So if you write a little module that has
the same interface then you can pretend you have a serial port attached
device and then switch over to an actual one without changing anything
else i
thanks chirs but i think i don't follow you , can you elaborate more ?
Thanks
On Mon, Jul 4, 2011 at 8:49 PM, Chris Fuller
wrote:
>
> You don't need to emulate a serial port (since you're writing the code; you'd
> have to emulate the port if it was standalone software), only your serial port
>
14 matches
Mail list logo