str object is not callable python

后端 未结 2 472
失恋的感觉
失恋的感觉 2021-01-23 03:51

I have tried looking around for an answer however the questions on here either seemed to advanced (I\'m new to Python) or because of redefining what something meant which I coul

相关标签:
2条回答
  • 2021-01-23 04:38

    Assuming you're using Python 3,

    print ("The area of your shape is: ", (a*b))
    #                                   ^
    

    You forgot a comma.

    0 讨论(0)
  • 2021-01-23 04:47

    You can print the value either with:

    print ("The area of your shape is: ", (a*b))
    

    or with

    print ("The area of your shape is: {}".format(a*b))
    
    0 讨论(0)
提交回复
热议问题