Python Word Repeater

Download an eBook today

This code will take a string you enter and repeat it for the number of times you specify using Python.

     * Featured code submitted and Created by Facu.


def repeater(word, cant):
 for i in range(cant):
 a = input()
 b = int(input())
 repeater(a, b)
except (ValueError):
 print("An error ocurred:")
 print("\nThe second value must be a whole number!")
except (EOFError):
 print("An error ocurred:")
 print("\nYou must enter a number in the second line!")

More Free Code Examples:

Python Code to Reverse a String

Hello World in 10 Programming Languages

8 Codes to Find Versions


Popular posts from this blog

Multi-tap Keypad Text Entry

HTML5 Crossword 1