in reply to how to store data in file with out using print
Why do you want to avoid print? Maybe you want to use write, which is just print combined with a format?