[Python] i tried to change in list from inside function and the list out [closed]

Discussão em 'Python' iniciado por Stack, Fevereiro 8, 2025.

  1. Stack

    Stack Membro Participativo

    def change(names):
    clear.Clear()
    print("""
    choice what do you wanna to change:
    1.First_name
    2.Age
    3.Country
    """)
    choice = input("Enter your choice: ")
    if choice == "1":
    clear.Clear()
    ask = input("Enter the first_name you wanna change: ")
    for a in names:
    if a.first_name == ask:
    new = input("Enter the new first_name: ")

    print("done..")


    i expected the list out of function will change by what happened inside the function

    Continue reading...

Compartilhe esta Página