[Tutor] Iterate over the list

jark AJ jarkmx at gmail.com
Tue Apr 28 11:59:01 EDT 2020


Hi All,

I want to iterate over the list and save the values
Is there a better approach than the one below?
Each of the names is unique and do not follow a pattern

names = ["name1","name2","name3","name4"]

for s in names:
    resp = requests.get(
    "https://{0}/APIendpoint".format(s)
)


More information about the Tutor mailing list