Write a programBasic10 XPExercise 2/16

Half pyramid

Task

The program reads a string and prints a half pyramid of it: the first character on the first line, the first two on the second, … and the whole string on the last line.

For the input Ahoj:

A
Ah
Aho
Ahoj

Examples

  • Input

    Ahoj

    Expected output

    A
    Ah
    Aho
    Ahoj

After you submit, 3 hidden tests will also check your solution: a single character, a longer word, a string with a space.

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.