basic question on loop & type casting / list/str/array

Kiran Kumar esxi1979 at gmail.com
Tue Mar 15 21:09:47 EDT 2022


Hi.

Pls check on below poython 3.9.x code & suggest how can i keep the string intactst in 2nd loop... ? these are aws ec2 ids

>>> INSTANCE_ID = ['i-0dccf1ede229ce1','i-0285506fee62051']

>>> for i in INSTANCE_ID:
...   print (i)
...
i-0dccf1ede229ce1
i-0285506fee62051
>>>
>>>
>>>
>>> for i in INSTANCE_ID:
...   for j in i:
...     print (j)
...
i
-
0
d
c
c
f
1
e
d
e
2
2
9
c
e
1
i
-
0
2
8
5
5
0
6
f
e
e
6
2
0
5
1
>>>


Thanks 
Kiran


More information about the Python-list mailing list