简体   繁体   中英

Can't understand why I am getting tuple error even though I typed everything correctly

I am trying to get 'Hi' and 'Hello' together using identifiers

INPUT:

ankur="Hi"
yash="Hello"
print(ankur, yash)

OUTPUT (Error):

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-41-733bc20e4385> in <module>()
      1 ankur="Hi"
      2 yash="Hello"
----> 3 print(ankur, yash)

TypeError: 'tuple' object is not callable

you are using a jupyter notebook. In previous or deleted cells you have redefined the print function to be a tuple. try to input only print without parenthesis to see what value it has.

To solve the issue, just restart the kernel.

Input

type(print)

output

<class 'tuple'>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM