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! While you're at it, check out some resources Treehouse students have shared here.
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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![dakota ferrell](https://secure.gravatar.com/avatar/d61eecae31a06e4280edf2586c423a38?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
dakota ferrell
2,336 Pointshow can I get this code to work?
l1 = ([1, 2, 3, 1, 2, 3])
l3 = set(l1)
l2 = list(set(l1)) l4 = list(l3) print(l1, l2, l3, l4)
def user_number (num): user_num = input ("whats your number?") num = user_num return user_num
number = print(user_number(1))
if user_number == 2: print("found")
3 Answers
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsYou almost had it, you just need to add parentheses to call your function:
if user_number() == 2:
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsIt's hard to read Python without Markdown formatting, and it's not clear what the program is intended to do. But one thing that stands out even now is that "user_number" is defined as a function but then later compared it with the number "2" as if it was a variable.
Also, "print" doesn't return anything so it's not useful to assign to the variable "number" (which is then not used anyway).
![dakota ferrell](https://secure.gravatar.com/avatar/d61eecae31a06e4280edf2586c423a38?s=60&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
dakota ferrell
2,336 Pointsim really just trying to think of away to get a if to print out a message to a certain number even though the number might change for instance the user inserts the number 1 then the if stament runs and they get a message but what if user2 uses the number 2 I want them to get the same message. I know there are better ways of doing this but I was wondering if I can make a if stament to run without knowing what the value is at a given point.
![dakota ferrell](https://secure.gravatar.com/avatar/d61eecae31a06e4280edf2586c423a38?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
dakota ferrell
2,336 Pointsis there a way to use a if statement with a {}.format() method?
![Steven Parker](https://uploads.teamtreehouse.com/production/profile-photos/969492/micro_tool_chess_set_2.jpg)
Steven Parker
230,688 PointsSure, but it doesn't look like you'd need that here. Or what did you have in mind?