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
  • 330,695
  • 80
  • 606
  • 657
Yun Tae Hwang
  • 925
  • 1
  • 11
  • 25

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
  • 596
  • 3
  • 5