Skip to content

Functions

Stardust D.L edited this page Jan 17, 2018 · 1 revision

Functions

Items Description
func{} A function with return value
class{} A class object
iter{} An iterator object
iter(val) Get an iterator of val
import(filepath) Import a module from file
array(n) Create an array with n null values
dict() Create a dictionary
print(arg1,arg2,...) Print the arguments
input([tip string]) Read a line from the console
int(string) Parse the string to integer
num(string) Parse the string to real number
str(val) Return the string of val
decimal(pricision) Create a decimal
sorted(any collection,[func]) Sort the collection ascendingly by the order of func's value, return the sorted list
select(any collection,func) Transform every element of collection by func
where(any collection,func) Get the elements of collection that func(element) is true
zip(collection1,collection2,func) Just like the Zip in C#
reduce(any collection,func) Just like the reduce in Python
range(int min,int max) Return the list [min,min+1,min+2,...,max]
view(class value) Return the dictionary of the class value
max(collections) Return the maximum
min(collections) Return the minimum
mean(collections) Return the mean
total(collections) Return the total
len(collections) Return the count
list(collections) Build a list from the collections
set(collections) Build a set from the collections
tuple(collections) Build a tuple from the collections
hasvar(variable name) Return if the variable exists
Clone this wiki locally