Question: Hello I need help with a python lab I have: Hello, I have a python lab I need help with: Write a python script that

Hello I need help with a python lab I have:

Hello, I have a python lab I need help with:

  • Write a python script that runs over http.
  • This script calls a function with the following parameters:
    • A string to be printed
    • The number of times to be repeated on separate lines in the browser
  • The function will print the string the number of times requested. For instance if the parameters were ("Ken", 20), Ken would be printed 20 times on separate lines. If the parameters were ("Green", 19) the word "Green" would be printed 19 times on separate lines.
  • The 'main' or 'toplevel' will call another function that prints a 2 x 2 table. Inside each of the 4 ''s of that table, you will make a separate call to the function you wrote. This function doesn't have any parameters.

This is what i have so far but I keep getting an error stating "TypeError: can only concatenate str (not "NoneType") to str" from line 18 below:

#!/usr/bin/python

print("Content-type:text/html ")

print('')

print('')

def name(wrd, num):

for i in range(num):

if i <= num:

print('

' + wrd + '

')

else:

break

def table():

print('

')

print('

')

print('

')

print('

')

print('

')

print('

')

print('

')

print('

')

print('

')

print('')

def main():

table()

main()

print('')

print('')

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!

' + name("yes",5) + ' ' + name("yes",5) + '
' + name("yes",5) + ' ' + name("yes",5) + '