Ask Your Question

sagenewbie's profile - activity

2016-09-04 19:55:46 -0600 received badge  Famous Question (source)
2014-12-24 02:55:32 -0600 received badge  Notable Question (source)
2013-07-18 03:46:34 -0600 received badge  Popular Question (source)
2011-08-01 09:43:17 -0600 commented answer Assigning variable values in a program

Using the global namespace worked great for my application. Thanks for the quick response.

2011-08-01 09:42:31 -0600 received badge  Supporter (source)
2011-08-01 08:09:57 -0600 asked a question Assigning variable values in a program

For a cryptography application, I want to assigned values of 0 or 1 to the following variables (x0, x1, x2, ..., x128). I want to define a function to take a hexadecimal representation of the 128 bits and assigned a 0 or 1 to each variable.

This can easily be done manually in sage by simply stating:
sage: x0 = 0
sage: x1 = 1 # and so on.

But I'm having finding a way to include this type of variable assignment in a function. I can do it by writting to a file and loading the file in Sage, but that required manual intervention to load the file.

Sorry if this is a trivial question, but I couldn't find an answer in the documentation

Thanks!