# Grasshopper - Function syntax debugging

A student was working on a function and made some syntax mistakes while coding. Help them find their mistakes and fix them.

Difficulty: introductory

Starter code:

def main(verb, noun):
	

Solutions:
def main(verb, noun): 
    return verb + noun

def main (verb, noun):
    # This function has three problems: square brackets instead of parenthesis,
    # a colon after the parenthesis and the return command inside the
    # function is not indented.
    return verb + noun

def main(*a):
    return ''.join(a)

def main(verb, noun):
    return f'{verb}{noun}'

def main (verb: str, noun: str) -> str:
    return verb + noun

main = '{}{}'.format

main = str.__add__

def main (verb, noun):
    output = verb + noun
    return output

main = lambda _,__:_+__

def main(verb: str, noun: str) -> str:
    """ Get a full sentence based on verb and noun. """
    return f"{verb}{noun}"

def main(*sen):
    return "".join(sen)

def main(verb, noun):
    msg = verb + noun
    return msg

def main(verb, noun):
    return verb + noun
main("take", "shit")



from operator import add as main

def main(*arr):
    return ''.join(arr)

def main (verb, noun):
    v = verb
    n = noun
    return v + n


main = lambda *n: ''.join(n)

def main(a, b):
    return ''.join([a, b])

def main(verb, noun):
    return f'{verb}{noun}'

print(main('take', ' item'))

def main(verb, noun):
    return "{0}{1}".format(verb, noun)

def main (verbs,none):
    main = verbs + none
    return main

def main (v, n):
    return v + n
#pogchamp


def main(verb, noun):
    result = verb + noun
    return result

def main (verb, noun):
    newword = verb + noun
    return newword

def main(verb, noun):
    butt = str(verb)+str(noun)
    return butt

def main (n,m):
    return n + m

def main (verb, noun):
    return verb + noun
print(main('use','sword'))

def main(verb, noun):
    test = verb + noun
    return test

def main (verb, noun):
    try:
        return verb + noun
    except:
        return 'There was a problem.'

main = lambda verb,noun: f'{verb}{noun}'


def main(verb, noun):return ''.join((verb, noun))

def main (verb, noun):
    x = (verb+noun)
    return str(x)

def main(verb,noun):
    answer = ''
    answer = verb + noun
    return answer

main = lambda noun, verb: noun + verb

def main(verb, noun):
    i = verb + noun
    return(i)

def main(verb, noun):
    return '%s%s' % (verb, noun)

def main(v, n):
    return v + n

verb = 2
noun = 2

def main(verb, noun):
    
    return verb + noun
main(verb,noun)

def main(verb,noum):
    r = verb + noum
    return r

def main(verb, noun):
    return(verb + noun)
main(1, 1)

# def main [verb, noun]
# return verb + noun
def main(verb, noun):
    return verb + noun

def main(verb, noun):
    phrase = "".join([verb, noun])
    return phrase

def main(verb,noun):
    word = ''
    word += verb + noun
    return word



def main(verb,noun):
    return (verb + noun)
print((main('take ', 'item')))


def main(verb, noun):
    comp = verb + noun
    return comp

def main(verb,noun):
    'verb + noun'
    return (verb + noun)

main = lambda alpha,beta:alpha + beta

main=lambda v,b:v+b

def main (verb = 'say ', noun = 'hello'):
     return verb + noun

def main(verb='', noun=''):
    return str(verb) + str(noun)

def main (verb, noun):
    honestly = "{}{}".format(verb, noun)
    return honestly

def main (*args):
    return ''.join(args)

def main (verb, noun):
    a = verb + noun    
    return a

def main(verb, noun):
    x = verb + noun
    return x

print(main("verb", "noun"))

def main(verb, noun):
    verb = str(verb)
    noun = str(noun)
    return verb + noun

def main (verb, noun):
    res = verb + noun
    return res

def main(verb, noun):
    return verb+ noun
print(main('use ',' book'))

def main (verb, noun):
    return f"{verb + noun}"

def main(*words):
    return ''.join(words)

def main (verb, noun):
    return verb + noun
print(main)

main = lambda verb, noun: verb + noun

def main(verb, noun): # Changed the square brackets to parenthesis and added colon.
    return verb + noun # Corrected indentation.

main = lambda a, b: a + b

def main(verb, noun):
    return verb + noun

main("use", "item")

def main(verb, word2):
    return "%s%s" % (verb, word2)

def main (verb='', noun=''):
    return verb + noun

def main(verb, noun):
    return "{}{}".format(verb,noun)

def main(verb, noun):
    return str(verb + noun)

def main (a,b):
    return(a+b)

main = lambda verb, noun: "".join((verb, noun))

def main (verb, noun):
    sum = verb + noun
    return sum

def main(x,y):
    return x + y

def main(verb, noun):
    return verb + noun

main('take', 'item')

def main(verb, noun):
    return ''.join([verb,noun])

main = lambda x,y: f'{x}{y}'

def main (verb, noun):
    return str(verb) + str(noun)

def main (verb, noun):
    x = verb + noun
    return x

def main (verb, noun):
    return verb +''+ noun

def main(verb, noun):
    s = verb + noun
    return s

main =lambda *a:''.join(a)