Hi, I am currently trying to write a program for my project and am
trying to make the following syntax work:
if y_1=y_2:
[y_1,y_2]=2
elif y_1>y_2:
[y_1,y_2]=1
x=0
for y_1 in [1..2]:
for y_2 in [1..y_1]:
x += [y_1,y_2]
print x
The error messages I am getting is " TypeError:
'sage.rings.integer.Integer' object is not iterable ".
When this code is fixed and does work, the answer would be x=5.
Can anybody see where my code is going wrong please?
Kind Regards
Chappman
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org