Skip to content

Commit e325c0e

Browse files
authored
Create utils.py
1 parent cf91f9b commit e325c0e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cyaron/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def ati(array):
2+
"""ati(array) -> list
3+
Convert all the elements in the array and return them in a list.
4+
"""
5+
return [int(i) for i in array]
6+
7+
def list_like(data):
8+
"""list_like(data) -> bool
9+
Judge whether the object data is like a list or a tuple.
10+
object data -> the data to judge
11+
"""
12+
return isinstance(data, tuple) or isinstance(data, list)

0 commit comments

Comments
 (0)