Pick Apart Your User's Input (Solution)
I’ll be explicit and assign the first letter to a new variable that I’ll call here
first_letter, and then I will use
user_input, which will hold the string that the user input and then use indexing to get the first character by using square brackets and putting in
function and the string in here that says
"The first letter you
entered was", put a colon and a space, and then we’ll concatenate this with my variable, the
first_letter variable, but it will also uppercase it,
So I could also uppercase it here. I could say
user_input.upper(). That would work as well, but that’s a bit less readable, especially because for now I just called the variable
02:06 But anyway, so there are always different types of solutions. If you solved it in a different way, that’s fine as well. I’m going to stick with this, where I uppercase the first letter before printing it out.
Become a Member to join the conversation.