0d: 00h: 00m: 00s

🎁 Get 3 extra months of learning — completely FREE

That's 90 extra days to master new skills, build more projects, and land your dream job.

Become a PRO
Background Image

🎁 Get 3 extra months of learning completely FREE

Become a PRO
Danielle Hoyle
PRO
last week
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
yesterday
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.