I have the following variable 12345678901234567890
and I want to create a text file named with the part 78901
from the middle of the variable 123456(78901)234567890
How I can do that ?
Thanks
I have the following variable 12345678901234567890
and I want to create a text file named with the part 78901
from the middle of the variable 123456(78901)234567890
How I can do that ?
Thanks
string = '12345678901234567890'
name = string[6:11]
with open(name, 'w') as f:
f.write("hello world")