B
B
beduin012018-06-27 16:33:59
Python
beduin01, 2018-06-27 16:33:59

How to create custom data types?

Suppose I want to construct some type of data. Is it possible in Python to do something like:
my_datatype = [int, list, list]
and then:
my_datatype[0] = 123
my_datatype[1] = 'Mike'
my_datatype[2] = 'USA'
Or something similar.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stan Jones, 2018-06-27
@Stan_Jones

It is possible, there are classes for this in Python-e (class instruction).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question