0

Write a function called printx() that just prints the letter "x". Then write a function called multiplex() which takes as argument an integer and prints as many times the letter "x" as the integer indicates by calling the function printx() that many times.

I already came up with this

def printx():
    print ("x")
printx()

But I do not know how to proceed, some help is appreciated;)

Any suggestions?

Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
Sjeng
  • 1

1 Answers1

0

@Sjeng here is the code that you are looking for. Hope this helps you.

def printx():
    print('x')

def muliplex(num): # num is the number of times you want x to be printed
    for i in range(num):
        printx()
Akhilesh Pandey
  • 868
  • 8
  • 18
  • def printx(): print('x') printx() def muliplex(8): # num is the number of times you want x to be printed for i in range(8): printx() I did this, but still got an error message. – Sjeng Sep 04 '18 at 16:22
  • @Sjeng It works for me. Could you please send me the error message and if possible also a screenshot of your code? Would be glad to help you. – Akhilesh Pandey Sep 05 '18 at 03:02