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

Deleting multiple topics

It's hard to get things done in City government without good relationships. Sam is burning bridges with the general topics she created in the last exercise.

People are shunning her because she is blowing up their phones with notifications.

She decides to get rid of the general topics per department completely, and keep only critical topics.

Sam has created the boto3 client for SNS and stored it in the sns variable.

Help Sam regain her status in the bureaucratic social hierarchy by removing any topics that do not have the word critical in them.

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

Introduction to AWS Boto in Python

Kursa Göz Atın

Egzersiz talimatları

  • Get the current list of topics.
  • For every topic ARN, if it doesn't have the word 'critical' in it, delete it.
  • Print the list of remaining critical topics.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

# Get the current list of topics
topics = sns.____()['____']

for topic in topics:
  # For each topic, if it is not marked critical, delete it
  if "critical" not in topic['TopicArn']:
    sns.____(____=topic['____'])
    
# Print the list of remaining critical topics
print(sns.____()['____'])
Kodu Düzenle ve Çalıştır