Python – Teacher of Computing https://ahc.me.uk Aaron Harwood Connor Tue, 08 Apr 2025 16:32:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.2 Example of a basic for Loop in Python https://ahc.me.uk/example-of-a-basic-while-loop-in-python/ Sat, 05 Apr 2025 19:41:45 +0000 http://www.ahc.me.uk/?p=456 python


In this example, we have a list called fruits that contains three elements: “apple”, “banana”, “cherry” and “date”. We use a for loop to iterate over each element in the list. On each iteration, the variable fruit takes the value of the current element, and we print it out. The output will be:


Each element in the list is printed on a separate line, demonstrating the iteration over the list using the for loop.

]]>
Powered by atecplugins.com