Danielle Hoyle
PRO
last month
Daniellecountry asked

In for language in languages:, how does Python get language from languages? Does Python understand that one is singular and the other is plural, or are they just two different variable names?

Abhay Jajodia
Expert
last month
Abhay Jajodia answered

Python doesn’t care about singular/plural. languages is the list name, and language is just a variable you chose to store each item one by one, and you can name it anything like item or x. People often use language because it makes the code easier to read.

Example:

languages = ["English", "German", "French"]
for item in languages:
    print(item)

If you have more questions, I am here to help.

Python
This question was asked as part of the Learn Python Basics course.