Thread: 2^9876543

Results 1 to 3 of 3
  1. #1
    Commander X's Avatar
    Join Date
    Aug 2011
    Gender
    male
    Location
    Anonymous
    Posts
    723
    Reputation
    83
    Thanks
    2,499

    2^9876543

    So I need to solve 2^9876543, I did it in Python command line, but I want to export the answer to a .txt file but I'm terrible at coding can anyone show me the code in python on how to export the answer of 2^9876543 to a .txt file?


    "Christian Bible, the Gospel of Mark, chapter five, verse nine. We acknowledge this as an appropriate metaphor. We are Legion, a terminal of the Geth. We will integrate into Normandy."
    -Legion

  2. #2
    Alen's Avatar
    Join Date
    Oct 2007
    Gender
    male
    Location
    Liquid Generator
    Posts
    27,930
    Reputation
    2539
    Thanks
    4,216
    My Mood
    Fine
    Haven't used Python in a while, but I believe file = open(path, rights/mode) should return a file object. After that the most crude way would be to use file.write(string)

  3. #3
    Ixxz's Avatar
    Join Date
    Feb 2011
    Gender
    male
    Posts
    102
    Reputation
    13
    Thanks
    22
    My Mood
    Fine
    print ('Running...')
    text = open("Answer.txt", "w")
    x = 2**9876543
    text.write(str(x))
    print ('Complete.')

    ^What he said.
    Last edited by Ixxz; 05-05-2012 at 07:46 PM.