Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hello.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def smethod():

def cmethod(cls, something):
"""class method-to-be"""
print('value: {}').format(123)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syntax error in cmethod function at line 29 with incorrect print usage

The function cmethod on line 29 contains a syntax error due to incorrect indentation and misuse of print and .format(). This causes immediate runtime failure preventing execution. Correct by properly indenting the print statement and using print('value: {}'.format(123)) or print(f'value: {123}').

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrectly calling .format() on the result of print() function

The print() function returns None. Calling .format() on None will raise an AttributeError at runtime. The call should be print('value: {}'.format(123)).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect indentation and string formatting in cmethod() at line 29 cause syntax error

The function cmethod() defined on line 29 contains an indentation error and incorrect usage of the print function with .format(). This leads to a Python syntax error preventing code execution. Fix by indenting the print line properly and rewriting as print('value: {}'.format(123)).


cmethod = classmethod(cmethod)

Expand Down
Loading