Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Udfordring: Udskæring med Indeksfunktion | Strenge
Datatyper i Python

bookUdfordring: Udskæring med Indeksfunktion

Opgave

Swipe to start coding

Try to extract words using slicing, but in a little bit more complicated way. The syntax of slicing is the following:

word[start_index:end_index]

To find the start_index, use the index() method, and to find the end_index, use the index() method, and add the length of the word.

  1. Extract the word painful.
  2. Extract the word mistakes.
  3. Extract the word learn.

If you use all the methods that were explored, this task won't be challenging for you.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 11
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

Suggested prompts:

Can you explain that in more detail?

What are the main benefits or drawbacks?

Can you give an example?

close

bookUdfordring: Udskæring med Indeksfunktion

Stryg for at vise menuen

Opgave

Swipe to start coding

Try to extract words using slicing, but in a little bit more complicated way. The syntax of slicing is the following:

word[start_index:end_index]

To find the start_index, use the index() method, and to find the end_index, use the index() method, and add the length of the word.

  1. Extract the word painful.
  2. Extract the word mistakes.
  3. Extract the word learn.

If you use all the methods that were explored, this task won't be challenging for you.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 3. Kapitel 11
single

single

some-alt