2

I would like to get a number from the user lets say 3.

Now i want to create objects with the name 'user1 = User() , user2 = User(), user3 = User()'

is that possible at all?

or is there an alternative?

1
  • Use dictionary! Commented Feb 4, 2017 at 20:17

1 Answer 1

1

You might want to use a dict:

result = dict()
for i in range(10):
    result['user' + i] = 'some value'
Sign up to request clarification or add additional context in comments.

1 Comment

You helped me a lot. I tried it with lists but couldn't get it to work Thanks!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.