Jun-05-2019, 11:19 AM
I have something like below code:
arr = ['foo','bar']
def func():
return f"""
MY_STATEMENT (
{{
{arr[0]}: ${arr[0]},
{arr[1]}: ${arr[1]},
other_fixed_keys: 'some value'
}}
)
"""But the length of arr is unknown. It may be 0, 1, 2, ... n. So, how can I iterate it so that the above statement will be okay?
