| 1 | initial version |
You can check if the variables are already in the dictionary provided by globals() and reject those who are:
sage: vars_to_test = {'a', 'b', 'c', 'E', 'I', 'z'}
sage: my_vars = [i for i in vars_to_test if i not in globals()]
sage: print(my_vars)
['a', 'c', 'z', 'b']
Then you can define the variables through
var(my_vars)
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.