← Back to challenges

Secret Function 2.0

PythonHardstringslanguage_fundamentals

Instructions

Create a function based on the input and output. Look at the examples, there is a pattern.

Examples

secret("div*2") ➞ "<div></div><div></div>"

secret("p*1") ➞ "<p></p>"

secret("li*3") ➞ "<li></li><li></li><li></li>"

Notes

Input is a string.

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Sort Numbers in Descending Order