For loop python

By ayed_amira , on 01/24/2020 , updated on 09/10/2020 - 1 minute to read

In python, for loop is used for iterating over a sequence (that is either a list, a dictionary,a tuple, a set or a string).

Example :

fruits = [“apple”, “banana”, “cherry”]
for x in fruits:


I'm a data scientist. Passionate about new technologies and programming I created this website mainly for people who want to learn more about data science and programming :)


Leave a comment

Your comment will be revised by the site if needed.