I don't think you're asking the array module because you said it was a "primary question."
Python writes lists, not arrays.
Unlike the arrangement of C/C++, the list seems to have been named list because the length can vary dynamically and the type of element to store is independent.
How to write
variable = []
In fact, this is not a declaration, it is an assignment, but Python cannot hold a type fixed for a variable (dynamically transforming the type).
"This variable is only a list! There is no other type like an integer or a string!" It's impossible to decide together.
© 2024 OneMinuteCode. All rights reserved.