[Python] Keyword Arbitrary arguments [closed]

Discussão em 'Python' iniciado por Stack, Setembro 4, 2025.

  1. Stack

    Stack Membro Participativo

    Traceback (most recent call last):
    File "/Users/mac/Documents/python project /python course/100_days_of_python/argument_exs.py", line 86, in <module>
    student_info(name="Kwame", age=30, color="red", team="Liverpool")
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/Users/mac/Documents/python project /python course/100_days_of_python/argument_exs.py", line 83, in student_info
    for key,value in student_info:
    ^^^^^^^^^^^^
    TypeError: 'function' object is not iterable


    def student_info(**information):
    for key,value in student_info:
    print(key,":",value)

    student_info(name="Kwame", age=30, color="red", team="Liverpool")

    Continue reading...

Compartilhe esta Página