tried in this way Transform into numbers, but transforms in the framework of this cycle & nbsp; a - List of lines: ['0', '0', '0', '0', '0', '0', '0', '0', '0', '0'] for el
question@mail.ru
·
01.01.1970 03:00
List of lines to the list of numbers
answer@mail.ru
·
01.01.1970 03:00
The most idiomatic and ideologically verified method:
Result = [ int (item) for item in a] pre> for functional style lovers:
Result = line ( map ( int , a)
here
This option is considered less "" "" pythonic "" ", but also has the right to exist (at least, in many cases, recording through
about your first option: when you write el the link to the list element is recorded. But when you write el = int (EL) , then another link is simply recorded in the variable el , the list of the list does not change.
How to understand that this is a link, not a copy of the element? Here is an example of how the element itself is changing by calling the list of the list:
& gt; & gt; & gt; a = [], [], []] & gt; & gt; & gt; for el in a: el.ppend ( 1 ) & gt; & gt; a [ 1 ], [ 1 ], [ 1 ]] about the bastard (if it is suddenly necessary) On Python, it is more correct (easier and more pleasant, without any LEN invested in Range) through Enumerate:
For I, ITEM in enumerate (a): a [i] = int span> (item) & nbsp;