May-03-2020, 09:44 AM
Hi
I tried your code and I got the following error message. I'm using Python 2.7:
invalid syntax: test.py, line 4, pos 39 in file C:\python-scripts\test.py
f_out.write(f'{line} {index}\n')
The print operation is doing this correctly:
Thanks
I tried your code and I got the following error message. I'm using Python 2.7:
invalid syntax: test.py, line 4, pos 39 in file C:\python-scripts\test.py
f_out.write(f'{line} {index}\n')
The print operation is doing this correctly:
f = open("password.txt", "rt") s = f.read() f = open("password2.txt", "wt") for count in range(1900,2021): s+str(count) print({s},{count})But how do I write this operation to a file. I only have one line in the file which is password.
Thanks