plz help. stuck at a DMOJ Questio0n /u/Math_Kiddo Python Education

message = input("Enter your message: ") happy_count = 0 sad_count = 0 for i in range(len(message) - 2): if message[i:i+3] == ":-)": happy_count += 1 elif message[i:i+3] == ":-(": sad_count += 1 if happy_count == 0 and sad_count == 0: print("none") elif happy_count == sad_count: print("unsure") elif happy_count > sad_count: print("happy") else: print("sad") 

submitted by /u/Math_Kiddo
[link] [comments]

​r/learnpython message = input(“Enter your message: “) happy_count = 0 sad_count = 0 for i in range(len(message) – 2): if message[i:i+3] == “:-)”: happy_count += 1 elif message[i:i+3] == “:-(“: sad_count += 1 if happy_count == 0 and sad_count == 0: print(“none”) elif happy_count == sad_count: print(“unsure”) elif happy_count > sad_count: print(“happy”) else: print(“sad”) submitted by /u/Math_Kiddo [link] [comments] 

message = input("Enter your message: ") happy_count = 0 sad_count = 0 for i in range(len(message) - 2): if message[i:i+3] == ":-)": happy_count += 1 elif message[i:i+3] == ":-(": sad_count += 1 if happy_count == 0 and sad_count == 0: print("none") elif happy_count == sad_count: print("unsure") elif happy_count > sad_count: print("happy") else: print("sad") 

submitted by /u/Math_Kiddo
[link] [comments] 

Leave a Reply

Your email address will not be published. Required fields are marked *