0

Not sure How to fix this.

SyntaxError: Missing parentheses in call to 'print'. Did you mean print(IM.dtype # prints image type)?

plt.figure(figsize=(60,30))

IM = mh.imread('TestNodose.png')  # Loads in image
print IM.dtype                    # prints image type
pylab.imshow(IM)                  # shows image
pylab.gray()                      # makes it greyscale
pylab.show()

enter image description here

1
  • > Did you mean print(IM.dtype # prints image type)? whenever you have a hunch like this, you should go on and try. No harm if the test is failed but in this case you could have gotten the answer by yourself, which is more rewarding! :) Commented May 4, 2020 at 6:53

2 Answers 2

1

This is basically syntax error. Your notebook is using Python 3, and in Python 3 print function require parenthesis. Correct syntax: print()

In python 2, we don't need the parenthesis.

Sign up to request clarification or add additional context in comments.

Comments

0

in python 2 print don't need parenthesis, however you have to write them in python3.
The correct syntax is

print(IM.DTYPE)

because your jupyter notebook is using python 3

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.