Everything containing print() in python gets an error

Asked 2 years ago, Updated 2 years ago, 18 views

No matter how simple it is, print() will cause all errors.
The same goes for copying from a beginner's site.

Enter a description of the image here

python

2022-09-30 19:35

1 Answers

In Python 3, print is a variable; call print and

 'tuple' object is not callable

The error message indicates that the variable print contains tuple.

Perhaps such substitution has been carried out above the code provided.For example, the following code may be considered:

 print=(text1, text2)

Or

print=text1,

However, it is also a tuple, depending on the comma at the end.

To accurately reflect the results of your Notebook edits

As you seem to be using the Jupiter Notebook environment, once you clear the code, the impact on the running kernel (such as the contents of the variable) will not disappear.You must restart the kernel (runtime) and run all cells.


2022-09-30 19:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.