- 1
Como declaro un array de multiple tipo de dato, es decir que contenga Int y String?
tipo de dato combinado en array
1 ответ
0
To declare an array with elements of multiple data types (Int and String) in Python is by defining a custom class to represent a combined data type and then store instances of this class in the array. In this example, the MixedDataType class is used to hold a data type and its value. We then create an array mixed_array and populate it with instances of MixedDataType containing both integer and string values. Finally, we iterate through the array to print out the values based on their data type.
Take a look⤵️
https://sololearn.com/compiler-playground/cpq2P5Rrle00/?ref=app