Ask Your Question

Revision history [back]

The exec() function interprets its argument as pure Python code rather than Sage code. In Python 2, the code '4752/8677' rounds the ratio down to the nearest integer.

In any case, I would not recommend using the exec() command to read data from a file, as it could be a security risk and it may give confusing error messages if the data are not in the format that you expect. You might consider using pickle/csv/json instead.