Some elements from the list are converted into int
📁 List, Advanced Python Topics, example
Please tell me, is there a shorter way to convert the elements into the type int ?
Given, for example, the list a = ["2", "Hello", "3", "Hello"]
Is it possible to write the conversion shorter, but not like this:
a [ 0 ] = int (a [ 0 ]) a [ 1 ] = int (a [ 1 ]) a [ 3 ] = int (a [ 3 ]) The list is actually longer, I don't want to make such a column in the code.
No answers yet.
Log in to leave an answer
Blogs
Swift vs Python for Backend: What to Choose in 2025
Rust for Machine Learning: Capabilities and Limitations in Practice
Working with JSON in Swift: Parsing and Serialization for Beginners
Swift on Old iOS and macOS: Does Code Work on OS X 10.9 and iOS 7?