mercredi 23 juin 2021

how to make the function accept mix characters [duplicate]

a = ("ADD")

s = ("SUBTRACT")

m = ("MULTI")

def function (c1, c2, *c3):
    if a in c3 :
        print(c1 + c2)
    if s in c3:
        print(c1 - c2)
    if m in c3:
        print(c1 * c2)
    else:
        print("wrong value")

I want to make it accept capital and small and mix characters

function(86, 44, "Add")

Aucun commentaire:

Enregistrer un commentaire