Let's assume I want to write a row in a csv file. This row will be something like:
name,last_name,birthday,hobby1,hobby2,hobby3, ... , hobby200
I can create an array like ['name', 'last_name' .... ] but is there any possible way to set a range o
I assume you want this
List = ['name', 'last name', 'birthday']
List = List + ['hobby%d' %i for i in range(200)]
print(List)
output
['name', 'last name', 'birthday', 'hobby0', 'hobby1', 'hobby2', ....., 'hobby199']
if you don't want 0, and want 200 do range(1, 201)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With