Challenge: Check Substring

In this exercise, you will be required to check if a specific string exists in a given string.

Problem Statement #

In this challenge, you have to write code that checks if a string contains a specific string. Your code should return 1 if it does else return 0.

Sample Input #

The quick brown fox jumps over the lazy dog.

Check whether the said string contains the substring ‘jumps’.

Sample Output #

1

Hint: Use the built-in functions you learned about in the previous lesson.

Important Note: The code will pass one case by default when you test the code even without the solution. However, your code needs to pass all three test cases in order to be considered correct.

Coding Challenge #

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy