Using Python version 2.x , I’m trying to put the contents of a function into a text document. Can someone please push me in the right direction of where to look. My code at the moment looks like this:
def Main():
Class_AInput = int(raw_input('Enter Class A tickets sold: '))
total_profit(Class_A_Input)
def total_profit(Class_A_Tickets):
print (Class_A_Ticktes * 15)
text_file = open('test.txt', 'w')
text_file.write('Output: %s' % total_profit)
text_file.close()
Main()
Thanks for any help.
I’ve edit your syntax. I think you need to convert int to string first