TORONTO KIDS COMPUTER CLUB | Thursday Online Python Homework 07.11
16392
post-template-default,single,single-post,postid-16392,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Thursday Online Python Homework 07.11

16 Jul Thursday Online Python Homework 07.11

Question:

We often include emoticons in our text messages to indicate how we are feeling. The three consecutive characters πŸ™‚ indicate a happy face and the three consecutive characters πŸ™ indicate aΒ sad face. Write a program to determine the overall mood of a message.

Input Specification
There will be one line of input that contains between 1 and 255 characters.

Output Specification
The output is determined by the following rules:
β€’ If the input line does not contain any happy or sad emoticons, output none.
β€’ Otherwise, if the input line contains an equal number of happy and sad emoticons, output unsure.
β€’ Otherwise, if the input line contains more happy than sad emoticons, output happy.
β€’ Otherwise, if the input line contains more sad than happy emoticons, output sad.


Sample Input 1
How are you πŸ™‚ doing πŸ™ today :-)?

Output for Sample Input 1
happy


Sample Input 2
πŸ™‚

Output for Sample Input 2
none


Sample Input 3
This:-(is str:-(:-(ange te:-)xt.

Output for Sample Input 3
sad

No Comments

Sorry, the comment form is closed at this time.