def rgrep(pattern='', text='', case=''):
    if pattern == '' or text == '':
        return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
    else:
        if case == 'i':
            return pattern.lower() in text.lower()
        else:
            return pattern in text

def display_usage():
    return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'


def rgrep(pattern='', text='', case=''):
    if pattern == '' or text == '':
        return display_usage()
    else:
        if case == 'i':
            pattern = pattern.lower()
            text = text.lower()

        return pattern in text

Refactor the case insensitive option
Refactor the case insensitive option

+ def display_usage():
+     return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
+ 
+ 
  def rgrep(pattern='', text='', case=''):
      if pattern == '' or text == '':
-         return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
+         return display_usage()
      else:
          if case == 'i':
+             pattern = pattern.lower()
+             text = text.lower()
-             return pattern.lower() in text.lower()
-         else:
-             return pattern in text
  
+         return pattern in text
+ 
Refactor the case insensitive option
## Code Before:
def rgrep(pattern='', text='', case=''):
    if pattern == '' or text == '':
        return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'
    else:
        if case == 'i':
            return pattern.lower() in text.lower()
        else:
            return pattern in text

## Instruction:
Refactor the case insensitive option
## Code After:
def display_usage():
    return 'Usage: python rgrep [options] pattern files\nThe options are the same as grep\n'


def rgrep(pattern='', text='', case=''):
    if pattern == '' or text == '':
        return display_usage()
    else:
        if case == 'i':
            pattern = pattern.lower()
            text = text.lower()

        return pattern in text
