Ask Your Question

sagenewbie's profile - activity

2016-09-05 02:55:46 +0100 received badge  Famous Question (source)
2014-12-24 09:55:32 +0100 received badge  Notable Question (source)
2013-07-18 10:46:34 +0100 received badge  Popular Question (source)
2011-08-01 16:43:17 +0100 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 16:42:31 +0100 received badge  Supporter (source)
2011-08-01 15:09:57 +0100 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!