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

Python Python Basics (Retired) Pick a Number! Any Number! The Solution

Corey Mann
PLUS
Corey Mann
Courses Plus Student 1,143 Points

"The Solution" - getting error in line 25.

I've typed exactly what the intructor has typed, have reviewed the video intructions, and my code numerous times, but I keep getting a syntax error on line 25.

print("It took you {} tries.".format(len(guessed_num)))

So far the debugging has gone well and I've been able to fix every error, but this one is giving me a hard time. Please help and thank you.

Also, the console doesn't like to allow me to type in it. The cursor keeps moving up to the work area. It takes a few tries to input commands, and I have to watch the work space carefully since the cursor jumps up there and types my console commands into the code. It does it both on my Windows 7 using Chrome computer and Ubuntu with Firefox. Kind of slows down progress because it get's frustrating. I'd like help with that as well. Thank you, and have a great day.

2 Answers

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

Sometimes the error is in the last statement previous to the reported error. This happens when the interpreter is looking for a missing end quote or closing paren and errors when it doesn't find it in the subsequent statement.

What is the previous statement?

Corey Mann
PLUS
Corey Mann
Courses Plus Student 1,143 Points

You are correct, and thank you. I was missing a parentheses at the end of line 24.

print("You Win! My number was {}.".format(rand_num) - had it written like this.