Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Dorota Parzych
5,706 Pointserror: 'tuple' object is not callable
Hi, I have got an error in my code...
I wanted to write a program that accepts a sequence of numbers separated by commas and generates their list and tuples.
Then it checks if a given value is in a given list of numbers. E.g: 4 -> [1,4,3,7]: true -10 -> [1,4,3,7]: false
values = input("Input some comma seprated numbers : ")
list = values.split(",")
tuple = tuple(list)
print('list : ',list)
print('Tuple : ',tuple)
number = print("")
searched_number = input("Please enter the number you are looking for: ")
if searched_number in tuple:
print("True")
else:
print("False")
1 Answer

Steven Parker
225,728 PointsThe code shown above runs without an error. Did you perhaps post the wrong code?
One thing in it is rather odd, though:
number = print("")
This statement prints an empty line but doesn't assign "number" with anything useful. And "number" isn't used later in the code.
Dorota Parzych
5,706 PointsDorota Parzych
5,706 PointsI have no idea what this line is doing in my code, βto be honest, haha
number = print("")
anyway, I am sending you a link down here... link: https://w.trhou.se/b53o9stw21 cause anyway it shows:
Steven Parker
225,728 PointsSteven Parker
225,728 PointsThis is what I get when I run it:
But you're clearly running different code, because in your output sample the prompt says "comma-separated" but in the snapshot it is "comma seprated".