Count happiness

Report a typo

Read the input and count how many times the substring happy appears in it. Print the number.

Sample Input 1:

If you're happy and you know it, clap your hands If you're happy and you know it, clap your hands If you're happy and you know it, then your face will surely show it If you're happy and you know it, clap your hands If you're happy and you know it, stomp your feet If you're happy and you know it, stomp your feet If you're happy and you know it, then your face will surely show it If you're happy and you know it, stomp your feet If you're happy and you know it, shout 'Hurray!' (Hurray!) If you're happy and you know it, shout 'Hurray!' (Hurray!) If you're happy and you know it, then your face will surely show it If you're happy and you know it, shout 'Hurray!' (Hurray!) If you're happy and you know it, do all three (hurray!) If you're happy and you know it, do all three (hurray!) If you're happy and you know it, then your face will surely show it If you're happy and you know it, do all three (hurray!)

Sample Output 1:

16
Write a program in Python 3





___

Create a free account to access the full topic