Good morning

Report a typo

Jo likes to start the morning with a good mood, so he wrote the following function for himself:

def good_morning(name):
    print("Good morning, ", + name)

good_morning("Jo")

But when trying to call the function, he saw an error message:

Traceback (most recent call last):
  File "C:/Users/laysa/PycharmProjects/untitled/file.py", line 8, in <module>
    good_morning("Jo")
  File "C:/Users/laysa/PycharmProjects/untitled/file.py", line 6, in good_morning
    print("Good morning, ", + name)
TypeError: bad operand type for unary +: 'str'

Our task is to disassemble the resulting traceback into parts and find a suitable description for each block.

Match the items from left and right columns
TypeError: bad operand type for unary +: 'str'
File "C:/Users/laysa/PycharmProjects/untitled/file.py", line 6, in good_morning
print("Good morning, ", + name)
File "C:/Users/laysa/PycharmProjects/untitled/file.py", line 8, in <module>
good_morning("Jo")
This block contains the name of the error and its description.
This block contains the function call in the executable file, as well as its location.
This block contains the line that raised the exception, as well as the name and location of the function in which this line is located.
___

Create a free account to access the full topic