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,859

    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?
    [IMG]https://i1213.photobucke*****m/albums/cc463/masks1/my_loving_flame_by_mj_magic-d5gkrqk.jpg[/IMG]

    "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,920
    Reputation
    2548
    Thanks
    4,224
    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
    23
    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 06:46 PM.