Loop with Python List
Rushikesh J.
QA Automation Engineer @Vinz Global | Robot Framework | Manual Testing, Automation Testing | Python | Selenium | GIT | JIRA | Immediate Joiner | API Testing Using Postman | Jenkins
Using loop with List, we can iterate one by one items of a list.
We can check all the items one by one to get required items in different ways.
Example
Finding specific student name in a student list
Getting even number from a range 1 to 100
Getting odd number from a range 1 to 100
Example
language? = ['Python', 'C++', 'JavaScript', 'C', 'Java', 'HTML']
for i in language:
? print(i)
Why we used Loop with List
?Using loop, we can analyze all the items or elements of a list
?Using loop, we can display all the items to screen
?Using loop, we can find any specific items or element from a list
?A lots of problem can be solve using loop with List