Prove That "a" Isn't in "AAA" (Exercise)
00:00
Here’s your next exercise. In one line of code, display the result of trying to find the substring "a"
in the string "AAA"
using .find()
.
00:10
So that’s a string method again, and the result should be -1
, which is what you get if the substring is not in a string and you’re using the .find()
method.
00:21 There’s a little flashback to remember how you changed the case and did some proofing tests that lowercase and uppercase characters aren’t the same, but a bit of an extension using a different string method to work with that.
00:34 Okay, let’s try it out and then move on to the next lesson.
Become a Member to join the conversation.