Dcoder icon

Three's Company @ Dcoder

By Lochard | As a newbie programmer | 19 Mar 2023


Problem: This problem requires you to create a output string from input string such that for every character in input string, there are three same characters in output string.

Input: First line contains N, the number of letters in the string.

The next line contains the string.

Output: Print the output_string.

Constraints: 1 ≤ N ≤ 20

Sample Input: 5

Hello

Sample Output: 

HHHeeellllllooo

input()
for s in input():
  print(s*3, end='')

How do you rate this article?

1


Lochard
Lochard

20240228 Arrived in the UK for about 2 week. All my fears persist. Some are even getting worse. https://github.com/locharp/asylum_diary/


As a newbie programmer
As a newbie programmer

Sharing entry level codes. My snippets on GitHub https://github.com/locharp/code-snippets

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.