Skip to content

Instantly share code, notes, and snippets.

@bholzer
Created June 11, 2014 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bholzer/d140695f455cdeff93b5 to your computer and use it in GitHub Desktop.
Save bholzer/d140695f455cdeff93b5 to your computer and use it in GitHub Desktop.
import sys
def main():
Scanner = Scanner("info.dat")
Boolean = Scanner.readbool()
String = Scanner.readstring()
Number = Scanner.readint() #no need to wrap this in int() since readint will do that automatically
if Boolean: #Here, you don't need to do == "True" because the readbool function automatically converts things correctly
print('{s}\n"{s}"'.format(s=String))
else:
print (2*Number)
return 0;
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment