I want to assign my image names to another string. Below I have described the problem.
num=[10,20,30,40,50,60,.....500]
for i in range(len(num)):
img[i]=str(num[i])+'_image_plane_XX_YY.fits'
so after this loop it should give me,
img0='10_image_plane_XX_YY.fits'
img1='20_image_plane_XX_YY.fits'
....
img499='500_image_plane_XX_YY.fits'
this means, img0 equal the image name of 10_image_plane_XX_YY.fits, img1 equal the image name of 20_image_plane_XX_YY.fits, etc. So I just need to use img0, img1,..for my corresponding images in further analysis. But, when I run this loop, it gives me following error
TypeError: 'str' object does not support item assignment
Please let me know any sollution for this.
Thanks in advance!
Cheers,
-Viral