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 Types and Branching Numeric

Why were apostrophes not needed when you ran the command: int(, or round(?

In the video, I noticed you did not have to add apostrophes to the syntax. Are numbers not apart of a string literal? Or does Python not see individual numbers as chunks?

Not sure what you mean. Why don't you give an example of what you saw in the video, and then show what you thought it should have been.

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,457 Points

As Python parses code it sees tokens (chunks of code) as either:

  • built-in keywords or functions,
  • user-defined objects and variables (object labels)
  • literal strings (bound by quotation marks)
  • numbers

Since objects and label names can not have a number as the first character, the int() and round() will determine they are operating on a number.

Post back if you need more help. Good luck!!!

Ah that makes sense! cool, thank you!