Check the Beginning of a String (Exercise)
00:00
The next exercise is about checking the beginning of a string. So you’re still working with string methods, and here you should write a program that prints out the result of using .startswith()
and then the string "be"
as an argument on each of the following strings.
00:15
So you’re going to have four strings again, and you want to call on each of those the string method .startswith()
, passing in "be"
as an argument to that, and then see what the output is.
00:26 You can also think about it now. What do you expect the output to be for each of those strings? Then hop over into your IDLE session, try it out, see whether you were correct, and then you can also go over to the next lesson and see me do it as well.
Become a Member to join the conversation.