Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 924 Bytes

I_love_you_a_little_a lot_passionately_not_at_all.md

File metadata and controls

45 lines (27 loc) · 924 Bytes

CodeWars Python Solutions


I love you, a little , a lot, passionately ... not at all

Who remembers back to their time in the schoolyard, when girls would take a flower and tear its petals, saying each of the following phrases each time a petal was torn:

  • I love you
  • a little
  • a lot
  • passionately
  • madly
  • not at all

When the last petal was torn there were cries of excitement, dreams, surging thoughts and emotions.

Your goal in this kata is to determine which phrase the girls would say for a flower of a given number of petals, where nb_petals > 0.


Given Code

how_much_i_love_you(nb_petals):
    pass

Solution

how_much_i_love_you(nb_petals):
    means = ["not at all", "I love you", "a little", "a lot", "passionately", "madly"]
    return means[nb_petals % 6]

See on CodeWars.com