← Back to challenges

Check if String Ending Matches Second String

PythonHardvalidationstrings

Instructions

Create a function that takes two strings and returns True if the first string ends with the second string; otherwise return False.

Examples

check_ending("abc", "bc") ➞ True

check_ending("abc", "d") ➞ False

check_ending("samurai", "zi") ➞ False

check_ending("feminine", "nine") ➞ True

check_ending("convention", "tio") ➞ False

Notes

All test cases are valid one word strings.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Calculate the Mean