LearnPy Hub
← File Handling problems
Easy

w Replaces the File

Write old text to f.txt. Then open it again in 'w' mode and write the input line. Print the file's contents: only the new text is left.

Input

One line.

Output

One line.

Sample 1

Input
new text
Output
new text

Sample 2

Input
hello
Output
hello
solution.py
Output appears here
w Replaces the File · Python practice problem · LearnPy Hub