dragon3.py


Below is the syntax highlighted version of dragon3.py from §1.5 Input and Output.


#-----------------------------------------------------------------------
# dragon3.py
#-----------------------------------------------------------------------

import stdio

dragon = stdio.readString()
nogard = stdio.readString()

stdio.write(dragon + 'L' + nogard)
stdio.write(' ')
stdio.write(dragon + 'R' + nogard)
stdio.writeln()

#-----------------------------------------------------------------------

# python dragon3.py < input.txt | python dragon3.py | python dragon3.py
# FLFLFRFLFLFRFRF FLFLFRFRFLFRFRF


Copyright © 2000–2015, Robert Sedgewick, Kevin Wayne, and Robert Dondero.
Last updated: Fri Oct 20 20:45:16 EDT 2017.