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
santhosh gattu
551 PointsPython Invalid Syntax Error
43 + 9 * + 7 106
65 + 8 + * 7 SyntaxError: invalid syntax
Can some one please help.
- + - Works
- * - Doesn't work
2 Answers
Cole Wilson
7,413 PointsI think the + sign is overloaded in meaning. It seems like in the first case the + is setting the sign of the number 7 for use in the multiplication.
As an example, try 43 + 9 * - 7 and notice the output is -20.
santhosh gattu
551 PointsThanks
santhosh gattu
551 PointsGood question Brendan. Nothing useful. But i'm curious when this q? came up while learning precedence of operators and how come one can be executed and other cannot.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsI don't know the answer.
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsBrendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsWhy do you have the * and + operators right next to each other? What are you trying to do?