F
F
From Prog2021-07-14 23:49:23
Python
From Prog, 2021-07-14 23:49:23

How to replace values ​​in an array in python without indices?

There is an array abc = ['1', '4', '45']

.replace with an array does not work

How to change the values ​​of all these variables without abc[0] = ..., for example, to the same variables +5

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0ralo, 2021-07-15
@FromProg

abc = ['1', '2', '5']
abc_done = list(map(lambda x: int(x) + 5, abc))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question