Answers for "Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa."

0

Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa.

Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa.
def generateString(char, val):
  output = ""
  for i in range(0, val):
    output = output + char
  return(output)
print(generateString(character, count))
Posted by: Guest on February-04-2020

Code answers related to "Create a function generateString(char, val) that returns a string with val number of char characters concatenated together. For example generateString('a', 7) will return aaaaaaa."

Python Answers by Framework

Browse Popular Code Answers by Language