[Python] How does defining what a function will return work [closed]

Discussão em 'Python' iniciado por Stack, Setembro 29, 2024.

  1. Stack

    Stack Membro Participativo

    If i have a function Like:

    def datamodelAuth(data : dict) -> str:
    dataModelkeys = list(dataModel.keys())
    dataKeys = list(data.keys())
    count = 0
    for keys in dataModelkeys:
    if keys not in dataKeys:
    return f"{keys} not found"
    else:
    count += 1
    if count == len(dataModelkeys):
    ret = createUser(data) # this function returns a string
    return ret


    Will this return the string from the createUser() function?

    I have tried testing with string but i still had issues.

    Continue reading...

Compartilhe esta Página