[Tutor] HELP! How do I remove the black after "s="

2014-05-10 Thread 1 2
In the result it shows "s= 8" pls tell me how to remove the blank?

s,t,n = 0,0,1
while t <= s:
s,t,n = s+2,t+n,n+1
else:
print('s=',s,n)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How do I create a "loop until" looping structure?

2014-05-21 Thread 1 2
Hi there,
  As shown in the codes below, I want to end the loop until the s is no
greater than -5 but I found there is no "do... loop until..." like C so
what should I do? I will write it in C's style

s,n = 0,1
do:
import math
s=s+(math.log((n+1)/(n+2))/math.log(2))
loop until s < -5
print(s)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor