Python Forum
[split] Something went wrong - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: [split] Something went wrong (/thread-1454.html)



[split] Something went wrong - Student - Jan-04-2017

Hello all,

What is here wrong???
def repeat (symbol,n):
    res = ""
    while((n> 0)):
        res=(res+symbol)
        n=(n-1)
    return res
def draw_line (n):
    return repeat("*",n)
def draw_square(n):
    l=(draw_line(" ")+"\n")
    return repeat(res,n)
res=draw_square(3)
print (res)
The output must be:
"
Output:
*** *** ***
"
"rint (res)linerepeatdraw_line


RE: [split] Something went wrong - nilamo - Jan-04-2017

(Jan-04-2017, 10:01 PM)Student Wrote: Hello all,

What is here wrong???

1) you hijacked a thread that was completely unrelated
2) you didn't use code tags
3) you didn't say what the error you're getting is
4) draw_square() references an undefined variable, so it wouldn't run if anyone tried to help.