I see in the code on this Sage wiki page the following code:
@interact
def _(order=(1..12)):
Is this (1..n)
syntax unique to Sage or is it something in Python? Also, what does it do?
I see in the code on this Sage wiki page the following code:
@interact
def _(order=(1..12)):
Is this (1..n)
syntax unique to Sage or is it something in Python? Also, what does it do?
This is not Python syntax. I would guess that it creates a range from 1 to 12.
There was a Python PEP to add this notation to Python, but it was rejected. Robert Bradshaw decided to implement it anyways, but for the Sage preparser. He implemented the following:
(a..b) -- like xrange, so an iterator
[a..b] -- list, including endpoints
[a,b,..,c] -- arithmetic progression