Challenge: Retrieving Letters from String
Opgave
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_charto store the first character of the string. - Create a variable called
last_charto store the last character of the string. - Create a variable called
highlighted_wordto store the word"for"extracted from the string.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 9
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Suggested prompts:
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 1.67
Challenge: Retrieving Letters from String
Stryg for at vise menuen
Opgave
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_charto store the first character of the string. - Create a variable called
last_charto store the last character of the string. - Create a variable called
highlighted_wordto store the word"for"extracted from the string.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 2. Kapitel 9
single