list(), set(), poly1()
Publié : ven. mars 15, 2019 2:12 pm
hello, many of the outputs of the Python procedures are sequences, to be able to print the object as a single entity you have to convert it into a list,
list( (1,2) ) # python returns [1,2]
in Xcas the function to convert a sequence in list is makevector(), for example makevector( (1,2) ) or makevector( 1,2 ) returns [1,2], for compatibility please can create the list() alias of makevector()
thank you
PD: other functional aliases can be
set() converts a sequence into set: set( "a", "a", "b", "c", "a" ) > set[ "a", "b", "c"]
poly1() converts a sequence into a polynomial of a variable: poly1( 1, -6, 11, -6 ) > poly1[ 1, -6, 11, -6 ]
seq1:=1, -6, 11, -6
poly1(seq1) > poly1[ 1, -6, 11, -6 ]
Note: on some keyboards other than the English language you have to press two simultaneous keys plus a third to obtain "[" or "]" in this way it is faster to enter mathematic objects using functional commands with parentheses ()
list( (1,2) ) # python returns [1,2]
in Xcas the function to convert a sequence in list is makevector(), for example makevector( (1,2) ) or makevector( 1,2 ) returns [1,2], for compatibility please can create the list() alias of makevector()
thank you
PD: other functional aliases can be
set() converts a sequence into set: set( "a", "a", "b", "c", "a" ) > set[ "a", "b", "c"]
poly1() converts a sequence into a polynomial of a variable: poly1( 1, -6, 11, -6 ) > poly1[ 1, -6, 11, -6 ]
seq1:=1, -6, 11, -6
poly1(seq1) > poly1[ 1, -6, 11, -6 ]
Note: on some keyboards other than the English language you have to press two simultaneous keys plus a third to obtain "[" or "]" in this way it is faster to enter mathematic objects using functional commands with parentheses ()