22 lines
581 B
Python
22 lines
581 B
Python
"""This module provides a function to convert a number into a string that
|
|||
|
|
contains raindrop sounds corresponding to certain potential factors."""
|
||
|
|
|
||
|
|
def convert(number):
|
||
|
|
"""Converts a number into a string that contains raindrop sounds
|
||
|
|
corresponding to certain potential factors."""
|
||
|
|
sound = ""
|
||
|
|
digit=True
|
||
|
|
|
||
|
|
if number % 3 == 0:
|
||
|
|
sound += "Pling"
|
||
|
|
digit=False
|
||
|
|
if number % 5 == 0:
|
||
|
|
sound += "Plang"
|
||
|
|
digit=False
|
||
|
|
if number % 7 == 0:
|
||
|
|
sound += "Plong"
|
||
|
|
digit=False
|
||
|
|
if digit: sound = f"{ number }"
|
||
|
|
|
||
|
|
return sound
|