[Python] Python function with Input fail to execute? [closed]

Discussão em 'Python' iniciado por Stack, Junho 18, 2025.

  1. Stack

    Stack Membro Participativo

    I have tried using several techniques to execute the following function with input. But code still fail. Any idea on how to fix this.

    def calculate_love_score("Sandra Ologolo", "Oloruntobi Onakomaiya"):
    combined_names = "Sandra Ologolo" + "Oloruntobi Onakomaiya"
    lower_names = combined_names.lower()

    t = lower_names.count("t")
    r = lower_names.count("r")
    u = lower_names.count("u")
    e = lower_names.count("e")

    first_digit = t + r + u + e

    l = lower_names.count("l")
    o = lower_names.count("o")
    v = lower_names.count("v")
    e = lower_names.count("e")

    second_digit = l + o + v + e


    score = int(str(first_digit) + str(second_digit))

    print(score)

    calculate_love_score("Sandra Ologolo", "Oloruntobi Onakomaiya")

    Continue reading...

Compartilhe esta Página