<< pyList scithon pyTuple >>

scithon >> scithon > pySet

pySet

Creates a python set.

Syntax

pySet(pyVar var_name) // creating Set from another python variable
pySet(arg0, arg1…) // creating set from elements

Arguments

arg0

Element to be inserted in the set

arg1

Element to be inserted in the set

var_name

pyList or pyTuple which has to be converted to a set

Description

Creates and returns a python set containing the arguments passed or transforms python list or tuple into a set. Arguments can be of type int, double, string, bool or python variable.

Example

--> pySet(1,2,3,4,1,2)
ans  =

{1, 2, 3, 4}
--> L = pyList(1,2,3,4,1,2)
L  = 

[1, 2, 3, 4, 1, 2]
--> S = pySet(L)
S  = 

{1, 2, 3, 4}

Report an issue
<< pyList scithon pyTuple >>