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 (2015) Logic in Python Around and Around

Sun Min
Sun Min
2,941 Points

when do we use quotation marks?

Hi, I'm working on loops now.

my question is why some of for loop has quotation marks and some of them are not. when should i use quotation marks? and when shouldn't?

on teachers note, when you see break and continue part it says

for letters in "abcdef":

it has quotation marks.

but when i see other code, I don't need quotation marks.

numbers =[1,2,3,4] for number in numbers:

it doesn't have quotation marks.

can you guys explain for me? :(

1 Answer

andren
andren
28,558 Points

Quote marks are used to denote a string, and that's all. When you are referencing a number or a variable or anything else that is not a string you don't use quotation marks. In your two examples "abcdef" is a string, while numbers is a variable.