9951 explained code solutions for 126 technologies


pythonHow to create file


with open('file.txt', 'w') as f:
  f.write('text')ctrl + c
'file.txt'

name of the file to create

'w'

used so that we can write something into new file

f.write

writes specified text into file

text

text to write into file

with open

opens specified file for manipulations