dimanche 28 mars 2021

Python condition to check whether "a"(case sensitive) has appeared more than twice [duplicate]

I want to test whether the letter a appears more than once in my string employee_name.

I have tried this code :

if 2*"a" in employee_name:
    return a

This did not work. What am I doing wrong?

Aucun commentaire:

Enregistrer un commentaire