Help in Python3 ! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Help in Python3 !

input = input('enter') with open('file.txt', 'w') as f: print( input , file=f) When I enter a value this code makes the file.txt of that input but I want to make a file.txt which have multiple values entered by me just like enter ( I entered a no.) enter ( it will ask again until I enter quit) enter quit It will make a file.txt of my all entered values

1st Apr 2020, 2:31 PM
Adnan Ahmad
Adnan Ahmad - avatar
1 Answer
+ 4
Gather Inputs and enter once or after opening again apply mode a instead of w.
1st Apr 2020, 2:38 PM
Oma Falk
Oma Falk - avatar