We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Self-repeat

From Esolang
Jump to navigation Jump to search

Program by Unicodes

Overview

This program gets a number from the user, let's say X, and prints X, X times

I/O
Input Output
0 ""
1 "1"
2 "22"
5 "55555"
10 "10101010101010101010"

Examples

Python

x = int(input())
print(str(x)*x)

Lua

x = io.read()
print((""..x):rep(x))