Write a programExercise 3/4Elementary20 XP

A square made of rows

Task

Write a function riadok(n, znak) that prints a row of n characters znak, and a function stvorec(n, znak) that prints an n × n square using riadok.

The call stvorec(3, "#") prints:

###
###
###

Examples

  • Call

    riadok(5, "*")

    Expected output

    *****
  • Call

    stvorec(3, "#")

    Expected output

    ###
    ###
    ###

After you submit, 3 hidden tests will also check your solution: a 1 × 1 square, a 4 × 4 square, stvorec calls riadok.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.