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)
![Lucy xu](https://secure.gravatar.com/avatar/40f99fb5fef7c8156f1b20c21328b79f?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Lucy xu
1,949 PointsInvalid syntax when I called the function
def sales (number): number=len(number) first_result=number*number print("The number{} squared is {}".format (number,first_result)
sales("good")
1 Answer
![Grigorij Schleifer](https://uploads.teamtreehouse.com/production/profile-photos/3207582/micro_wallhaven-15652.jpg)
Grigorij Schleifer
10,365 PointsHi Lucy, can you specify the problem you are trying to solve?
I modified your code and post it here with some comments. Do you want to square the number of characters in the string argument that you are passing to the sales method?
def sales(number):
number= len(number)
first_result = number * number
print("The number {} squared is {}".format(number, first_result)) # a parenthesis was missing here
sales("good")
The sales method will print the argument length and its squared product. Be careful though, the len function will count empty spaces too.