using python
with open('n.text','w')
If so, I would like to write the file instead of n=100, is there a good way?
Do you mean you want to write a file called 100.text
as n=100
?
You can combine strings using the +
operator.You can also use str
to convert numbers into strings.You can use them to do the following:
n=100
with open(str(n)+".text", "w")
© 2024 OneMinuteCode. All rights reserved.