Python Word Repeater
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.
Python
def repeater(word, cant):
for i in range(cant):
print(word)
try:
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!")
Comments
Post a Comment