superpollo wrote:
hi clp
what's the difference between:
while True:
input_line = sys.stdin.readline()
if input_line:
sys.stdout.write(input_line.upper())
else:
break
and:
while True:
try:
sys.stdout.write(sys.stdin.next().upper())
e
superpollo wrote:
> hi clp
>
> what's the difference between:
>
> while True:
> input_line = sys.stdin.readline()
> if input_line:
> sys.stdout.write(input_line.upper())
> else:
> break
>
> and:
>
>
> while True:
> try:
> sys.stdo
superpollo writes:
> while True:
> try:
> sys.stdout.write(sys.stdin.next().upper())
> except StopIteration:
> break
Maybe there is some subtle difference, but it looks like you really mean
for line in sys.stdin:
sys.stdout.write(line.upper())
--
http://mai