Why( 'TypeError:-' list object is not callable) showing up here when I am trying to print pizza.toppings() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Why( 'TypeError:-' list object is not callable) showing up here when I am trying to print pizza.toppings()

https://code.sololearn.com/c6311188N1Re/?ref=app

30th Aug 2021, 3:24 PM
Sanskriti Garg
Sanskriti Garg - avatar
3 Answers
+ 4
Last line is wrong, pizza.toppings is not a function so you must remove the parenthesis: Also you were calling pizza() instead of print(). print(pizza.toppings)
30th Aug 2021, 3:32 PM
Maz
Maz - avatar
+ 1
Adding onto what Maz said, here's the modified code so you can look at it side by side in comparison: https://code.sololearn.com/cOSNXNaL7Z9m/?ref=app
30th Aug 2021, 3:42 PM
Chloe
Chloe - avatar
0
Thanks for the help..got it👍👍
30th Aug 2021, 6:28 PM
Sanskriti Garg
Sanskriti Garg - avatar