I Need ['1', '2', '3']
to become this [1, 2, 3]
This is my actual code:
def chain_a_list_int(p_chain :str):
tab_chain=[] # [str]
tab_int=[] # [int] (list to return)
tab_chain = p_chain.split(",")
tab_chain = [int(i) for i in tab_chain]
tab_int.append(tab_chain)
return tab_int
and return it to use it like that:
chain_a_list_int(input("enter the number to conserve: "))
but it give me this error when i print it out of the function:
<function chain_a_list_int at 0x000000000349FEA0>
when i try to print i use this:
print(chaine_a_liste_entier)
when i print tab_int
in the function it work pretty well but it's not when i'm out of it...
print(tab_int)
Result...
[1, 2, 3]