Help in rotate 13 program

Peter Otten __peter__ at web.de
Thu Dec 29 08:10:16 EST 2011


Sayantan Datta wrote:

> please help me, this code doesn't work,
> the output file comes out to be empty. How do i fix it? and where is it
> going wrong?

I don't know if that's a copy-n-paste error: the indentation of

>   if __name__ == '__main__' :
>     for line in sys.stdin :
>       for char in line :
> sys.stdout.write(rotate13_letter(char))

should be

if __name__ == '__main__':
    for line in sys.stdin:
        for char in line:
            sys.stdout.write(rotate13_letter(char))





More information about the Python-list mailing list