Python question Ability to convert from numbers to characters in a list at once

Asked 2 years ago, Updated 2 years ago, 61 views

Is there a shortcut or code in the list that automatically converts numbers into characters?

For example,

a = [1,2,3,4,5] If it's like this, Any shortcut, module, or code at a time a = ['1','2','3','4','5'] Is there any conversion to that? I made a code to work on it, but it's hard to put in small quotes because there's a lot I'm asking if there's such a function.

list

2022-09-22 19:20

2 Answers

If you want to change the type within the program,

map(str, a)

If you want to change it to code, You can get help with the replace function of the editor.

Based on vscode

You can change it like this.


2022-09-22 19:20

Thank you so much! Thank you for the last time and thank you so much for this time... Things have gotten easier Thanks to you, I learned a lot!!!!! sensei!


2022-09-22 19:20

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.