How Do You Troubleshoot the Python Error “built-in method strip of str object at 0x7fc87bf4a0f0”?

Problem scenario
You are running a Python program with the "strip" string manipulation method. You get this problem:

<built-in method strip of str object at 0x7fc87bf4a0f0>

What should you do?

Solution
Did you remember to use the parentheses "()" with your strip call?

print(x.strip) can return "<built-in method strip of str object at 0x7fc87bf4a0f0>"

print(x.strip()) will return the intended value.

Leave a comment

Your email address will not be published. Required fields are marked *