
Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[tlug] variable assignments inside expressions in python
- Date: Tue, 10 Jul 2007 16:01:11 +0900
- From: "Hector Akamine" <akamine@example.com>
- Subject: [tlug] variable assignments inside expressions in python
Hi,
In C, I can do a variable assignment inside a while expression, like:
while ( (myvar = get_time( ) ) < DEADLINE) {
/* use the value of myvar somewhere*/
...
}
Trying to do the same in python
while ( (myvar = get_time( ) ) < DEADLINE):
throws an error. Is there a "python way" to do this? (I have googled
a little and the answer seems that I can't, but I refuse to accept it
:-) )
Thanks,
Hector
Home |
Main Index |
Thread Index