Oct-20-2019, 05:45 PM
As perfringo points out, that's not really possible. Once it's in the function, it's not a and b (or c and d) anymore. It's x and y. If you want the name to be available, you are going to have to store it explicitly. So if a and b are two dimensional points, you might be storing them as tuples: (2, 3) and (4, 5). To get the name out, you need to store it with the tuple. You could do a longer tuple: ('A', 2, 3) and ('B', 4, 5). You could do a dictionary: {'name': 'A', 'coord': (2, 3)} and {'name': 'B', 'coord': (4, 5)}. You could do a named tuple or even a full fledged class. But somehow you need to store the name.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures