Anonymizing the dataset

Report a typo

Suppose you have collected a dataset of tweets. Each tweet in the dataset starts with a username, for example, @elonmusk. They may contain references to other users that also start with the @ character. As it is very important to keep the collected data anonymous before working with it, your task is to replace usernames at the start of the string with the special <AUTHOR> tag and all other handles with <HANDLE>.

You will get a tweet as input, print out the modified version of it.

Sample Input 1:

@some_twitter_user I love dogs, @another_twitter_user!

Sample Output 1:

<AUTHOR> I love dogs, <HANDLE>!
Write a program in Python 3
import re

string = input()
# your code
___

Create a free account to access the full topic