Person X (Exercise)
00:00 Onto your next exercise. This one is about person X.
00:06
Use the tuple()
function and the string literal to create a tuple that you call my_name
. And it should contain the letters of your name.
00:15
Check whether the character X is in that tuple, and do that using the in
keyword. Then create a new tuple that contains all but the first letter in my_name
using slice notation.
00:27
So here you’re practicing to create a tuple using the tuple()
function, then using membership checking for an element inside of a tuple. And for the third point, you’ll have to create a copy of the tuple because they’re not mutable.
00:40 So you’re going to have to create a new tuple. And then use slice notation to not include all of the elements, but only some of them. All right, let’s go.
Become a Member to join the conversation.