Ok, I fell into the XY trap. Sorry for that. I'll rewrite my prblem:
I have a list of numbers, eg. l = [1,3,5,1,0,0,0]
I need a string containing the number for each number > 0. Let's say the string is
string = "Your number is %s" % (x)
How can I get this to work? Especially if there is two times the same number?
~~~~~~~~~~
Old Text:
I need some help here: I have a list, for example
numbers = [1,5,3,0,0,0,0]
Now I want to define a new variable for each of the numbers that is larger than zero and assign the number to it. For example I take the list above and end up with the variables:
o = 1
p = 5
q = 3
Also, what is important, if two numbers are the same, I still need one new variable for each of them, while those variable will have the same value.
So if my list was:
numbers = [1,5,3,1,0,0,0]
I need new variables like this:
o = 1
p = 5
q = 3
r = 1
Therefore I made the following function:
def check(LIST):
for x in LIST:
if x > 0:
#from here on I need help
I hope it became clear what I mean and that someone can help :)
Greetings