Writing a list to a txt file in Python
📁 Advanced Python Topics, bots, AI
Actually, how to write the result of a function to a txt file?
f = open( '***.txt', 'w' )f.write( '??????' )f.close() You can use a list generator:
s = '45 30 55 20 80 20'a = [int(x) for x in s.split()] Log in to leave an answer
Blogs