-
-
Save andriiburka/a3ce4f88030c97412622a3a9c6b813b3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
likes = {} | |
unlikes = 0 | |
while True: | |
usr_in = input() | |
if "Stop" in usr_in: | |
break | |
else: | |
usr_in = re.split('-', usr_in) | |
if "Like" in usr_in[0]: | |
if usr_in[1] not in likes: | |
likes[usr_in[1]] = [usr_in[2]] | |
else: | |
likes[usr_in[1]].append(usr_in[2]) | |
elif "Unlike" in usr_in[0]: | |
if usr_in[1] in likes: | |
print(usr_in[1]) | |
if usr_in[2] in likes: | |
print(usr_in[2]) | |
print(likes) | |
print(unlikes) | |
n | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment