TheBrahminCoder - How to Implement For in Loop in Python

Here is an example of how to write a for in loop in Python:


This will output:


In this example, the for loop is used to iterate over a  list of fruits. The variable x takes on the value of each item in the list, one at a time. The print() function is called once for each item in the list, with the value of x as an argument

Comments

Popular posts from this blog

TheBrahminCoder - What is script tag and types of scripts

TheBrahminCoder - What is CSS and types of CSS