0

In my code below, I used startswith() method to find out if an argument has word "sales" in it or not. However, it only checks if it starts with the word. How can I capture all the argument that has word "sales" in it? (regardless starts with, ends with, or in the middle)

def isSales(job):
    a = job.lower()
    if a.startswith('sales'):
        return 'True'

Thank you.

cs95
  • 379,657
  • 97
  • 704
  • 746
Yun Tae Hwang
  • 1,249
  • 3
  • 18
  • 30

1 Answers1

0

'startswith' as the name says it only checks at the beginning.

def isSales(job):
    a = job.lower()
    if 'sales' in a:
        return 'True'
Raju Pitta
  • 606
  • 4
  • 5