1

i struggle with a loop for my projekt: For example:

user = "1" , "2", ...

Link = www.test.com/

what can i do that it goes to

www.test.com/1
does something

www.test.com/2
does the same thing

...

so it does the same thing for every user

1
  • You should share more details along with code you've already tried Commented Feb 17, 2018 at 15:46

1 Answer 1

2

You can create a function and apply it to list of users:

def perform_for_each_user(user_list, link):
    for user in user_list:
        user_link = link + user
        print(user_link)
        # do something with user_link

users = "1" , "2", "3"

perform_for_each_user(users, "www.test.com/")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.