Challenge: Retrieving Letters from String
Task
Swipe to start coding
You are working with strings and need to extract specific parts of a given sentence. You have a sentence stored in a variable and need to extract the first character, last character, and a specific word from it.
- Create a variable called
first_char
to store the first character of the string. - Create a variable called
last_char
to store the last character of the string. - Create a variable called
highlighted_word
to store the word"for"
extracted from the string.
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 2. ChapterΒ 9
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Suggested prompts:
Summarize this chapter
Explain the code in file
Explain why file doesn't solve the task
Awesome!
Completion rate improved to 1.67
Challenge: Retrieving Letters from String
Swipe to show menu
Task
Swipe to start coding
You are working with strings and need to extract specific parts of a given sentence. You have a sentence stored in a variable and need to extract the first character, last character, and a specific word from it.
- Create a variable called
first_char
to store the first character of the string. - Create a variable called
last_char
to store the last character of the string. - Create a variable called
highlighted_word
to store the word"for"
extracted from the string.
Solution
Everything was clear?
Thanks for your feedback!
Awesome!
Completion rate improved to 1.67SectionΒ 2. ChapterΒ 9
single