Python One-Liner: Write String to File
Problem: Given a string and a filename. How to write the string into the file with filename using only a single line of Python code? Example: You have filename ‘hello.txt’ and you want to write string ‘hello world!’ into the file. How to achieve this? In this tutorial, you’ll learn four ways of doing it … Read more