variables

What is a variable?

A variable is like a container. We can give the variable a name, use it to store the data, read it, or change it. It is often used in actual programming.

Create variable

Click the Create variable option, enter the name of the variable, click OK to create

Using variables

For example: assign the variable initial value A=6, and add the variable 2 after one second.

operation

Function Description

There are some basic arithmetic blocks in Math, such as "addition, subtraction, multiplication and division".

constant Fill in any number and connect to other objects for assignment

Common operation Add data on both sides of the expression to add, subtract, multiply and divide power

Surplus Add data on both sides of the expression to make the remainder

Special number judgment Add a value to set whether the judgment is true (for example, whether it is odd or even or prime), if it is true, it is True, otherwise it is False.

Array calculation Summing an array, calculating the maximum or minimum, the average, etc.

round Rounding off decimals or going to the bottom

advance operation Find trigonometric functions, absolute values, etc.

convert to int Convert the value to an integer

convert to float Convert values to floating point numbers

Instructions

Add data to both sides of the expression, assign the expression to a variable or other object, and get the result.

random

Function Description

When making games or animations, we sometimes need some random elements, and Random can generate random numbers according to our needs.

random fraction Randomly generate a number between 0 and 1 each time it is executed

random integer Specify a random range, each time it is executed, randomly generate an integer in the range

Instructions

Set a random range with a constant and assign a random intger to a variable

map

Function Description

Map is another variable container model that can store any type of object.

creat map Create key-value pairs of map.

map clear clear key-value.

map contain key Confirm if there is a key in map

get ken in map Get the value of Specified key.

in map add key value Add key-value in map.

in map set key value change the value of key in map.

in map delete key Delete specified key

Instructions

Add a create map to create a map, add some elements to the map, Specify keywords and values

array

`````````````

Function Description

If the variable is a container, the array is a collection of many containers. We can assign values to any of the variables in the array.

length of Measure the length of the array (ie the number of elements in the array)

X is empty Determine whether an array is empty. When it is established, the expression is True, otherwise it is False.

in list find Array index, indexed positive or reverse specified element

create empty list Add a value to set whether the judgment is true (for example, whether it is odd or even or prime), if it is true, it is True, otherwise it is False.

create list with Customize an array

in list get Get the index value of an index element

in list get sub-list from Set an index to the specified value in the array

icreat list with item repeated times Create an array and use the element to repeat a certain number of times to fill

reverse Array in reverse order

in list set as Set an index to the specified value in the array

make list from text with delimiter Create an array from text, using a separator

Instructions

Add a create list to create an array, add some elements to the array, call elements iteratively or by using other methods

JSON

Function Description

JSON (JavaScript Object Notation) is a lightweight data exchange format that is easy for people to read and write.

dumps to json Encode Python objects into JSON strings.

loads json Decode an encoded JSON string into a Python object.

Instructions

Creat a map and turn it into json format

TEXT

Function Description

Use these blocks for text processing and screen display.

" " Assign text or String

to UPPER CASE Convert text to uppercase or lowercase.

in text get letter# Get the specified character from the text.

count in Find the number of occurrences of specific characters.

is empty Returns whether it is empty text.

length of Return text length.

print Print text.

replace with in Replace text.

trim spaces from both sides Remove spaces from both sides of the string.

Convert to str Convert other types to strings.

" "+ Text merging.

decode Decode the string in the encoding format specified by encoding.

encode Encodes the string in the encoding format specified by encoding.

Reduce to decimal places Retain the specified number of decimal places.

Instructions

On This Page