This document explains the current platform's support scope and limitations for the Python language.
Please adhere to the following rules to avoid using incompatible syntax features.
The following basic types are supported for declaration and use:
str
, int
, float
, bool
Example:
The following containers are supported:
Container Type | Example |
---|---|
One-dimensional array | arr=[1,2,3] |
Two-dimensional array | arr=[[1,2,3],[4,5,6]] |
dict | dict={"name":"Alice","age":18} |
Queue | q = Queue();q.enqueue(1);q.dequeue() |
Stack | s = Stack();s.push(1);s.pop() |
Constraints:
- Keys and values in dict must be of basic types
The following predefined structures can be used directly:
- Do not wrap your executable code in
if __name__ == "__main__":
. When we execute your code in the sandbox, it is not in the main file, so thisif
condition will returnFalse
. You can directly write the code you need to execute.