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) Things That Count Ints & Floats

Is there another command I have to call before creating my float? I tried "f_a = 5.5" and "f_a=5.5"

I seem to remember there was a deeper program within the workspace that we used to test these variables, but I can't remember what that was. I get "-bash: f_a: command not found" when I enter with the spaces, and no issue when I enter without spaces on either side of the equals, but when I try to call the float ie: "f_a" or "print(f_a)" I get errors. Thanks! I'll keep exploring to see if I can find the answer.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

If you are trying python statements in the workspace console, you need to start python interactively.

$ python
Python 3.4.0 (default, Apr 11 2014, 13:05:11) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

Then you can type the statement f_a = 5.5.

What you were seeing when not using spaces is the bash shell interpreting f_a=5.5 as an assignment to the environment variable f_a. Not a python interaction.

Right, duh. I knew it was something basic I was missing. Thanks!