Files
30-seconds-of-code/snippets/n_times_string.md
2019-09-27 09:07:25 +02:00

303 B

title, tags
title tags
n_times_string string,beginner

Prints out the same string a defined number of times.

Use this method to print out the same string n number of times.

def n_times_string(string,n):
  return (string * n)
n_times_string('py', 4) #'pypypypy'