Peter Otten wrote:
Something must be wrong with me today because I find the Pascal code /more/
readable...
Actually I don't find either of them very readable. The
control flow is pretty convoluted either way. It might
be better if it used real-life variable and function
names to give some cont
Am 03.03.2010 18:38, schrieb Tracubik:
Il Wed, 03 Mar 2010 09:39:54 +0100, Peter Otten ha scritto:
def loop():
count = 0
m = 0
lookup = {1: 1, 2: 10, 3: 100}
for iterations in range(20): # off by one
# ...
print "%2d %1d %3d" % (iterations, count, m) # ...
Il Wed, 03 Mar 2010 09:39:54 +0100, Peter Otten ha scritto:
> Tracubik wrote:
>
>> hi, i've to convert from Pascal this code:
>
> program loop;
>
> function generic_condition: boolean;
> begin
>generic_condition := random > 0.7
> end;
>
> procedure loop;
> var
>iterations, count, m: in
Gregory Ewing wrote:
Alf P. Steinbach wrote:
* Tracubik:
>
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
Uhm, is this syntactically valid Pascal? As I rec
Tracubik wrote:
> hi, i've to convert from Pascal this code:
program loop;
function generic_condition: boolean;
begin
generic_condition := random > 0.7
end;
procedure loop;
var
iterations, count, m: integer;
begin
iterations := 0;
count := 0;
m := 0;
repeat
iterations :=
On Tue, Mar 2, 2010 at 6:46 PM, Tracubik wrote:
> and, generally
> speaking, the try..except block slow down the execution of the program or
> not?
Try...except tends to be slow when the exception does occur, fast when
it does not. Apart from that, if these
fraction-of-a-fraction-of-a-second ga
Alf P. Steinbach wrote:
* Tracubik:
>
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
Uhm, is this syntactically valid Pascal? As I recall, every Pascal
cons
Tracubik wrote:
hi, i've to convert from Pascal this code:
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
UNTIL count = 4 OR iterations = 20
i do something
* Alf P. Steinbach:
* Alf P. Steinbach:
* Tracubik:
hi, i've to convert from Pascal this code:
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
Uhm, is this s
* Alf P. Steinbach:
* Tracubik:
hi, i've to convert from Pascal this code:
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
Uhm, is this syntactically valid Pa
* Tracubik:
hi, i've to convert from Pascal this code:
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
Uhm, is this syntactically valid Pascal? As I recall
additional information:
when count=4 i haven't to change the m value, so i have to do nothing or
something like m = m
Nico
--
http://mail.python.org/mailman/listinfo/python-list
hi, i've to convert from Pascal this code:
iterations=0;
count=0;
REPEAT;
iterations = iterations+1;
...
IF (genericCondition) THEN count=count+1;
...
CASE count OF:
1: m = 1
2: m = 10
3: m = 100
UNTIL count = 4 OR iterations = 20
i do something like this:
itera
13 matches
Mail list logo