BaşlayınÜcretsiz başlayın

Word tokens from the Avengers

Now that you have tokenized your first string, it is time to iterate over items of a list and tokenize them as well. An easy way to do that with one line of code is with a list comprehension.

A list avengers has been created for you. It contains a few quotes from the Avengers movies. You can explore it in the IPython Shell.

Bu egzersiz, kursun bir parçasıdır

Sentiment Analysis in Python

Kursa Göz Atın

Egzersiz talimatları

  • Import the required function and package.
  • Apply the word tokenizing function on each item of our list.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Import the word tokenizing function
from ____ import _____

# Tokenize each item in the avengers 
tokens_avengers = [____(item) for item in ____]

print(tokens_avengers)
Kodu Düzenle ve Çalıştır