<jupyter_start><jupyter_text>LOOPSA loop is a programming construct that enables repetitive processing of a sequence ofstatements. Python provides two types of loops to its users: the `for loop` and the `whileloop`. The `for` and `while` loops are iteration statements that allow a block of code (the body of the loop) to be repeated a number of times.  FOR LOOP- Python implements an iterator-based `for loop`. - It is a type of `for loop` that iterates over a list of items through an explicit or implicit iterator.- The loop is introduced by the keyword `for` which is followed by a random variable name which will contain the values supplied by the object.This is the syntax of Python’s ‘for loop’:            for variable in list:        statements        else:        statementsHere is an example of a `for loop`<jupyter_code># print even numbers from 2 to 40
for i in range(2, 40, 2):
    even= i
#     print(even)<jupyter_output><empty_output><jupyter_text>example 2: From a List = `[1,4,2,1,0,5,7,8,9,6,20,70,50,67,4,5,3]`1. print all the even numbers from the list2. sum all the even numbers<jupyter_code>List = [1,4,2,1,0,5,7,8,9,6,20,70,50,67,4,5,3]
for i in List:
    if(i%2==0):
        sum_of_even = i*i
        print(i)
print(sum_of_even)
import math as calc

sales = []

pizza = ['Style Pizza','Pan Pizza','Thin n Crispy Pizza','Stuffed Crust Pizza']

for choices in pizza:
    user = input('Your choice: ')
    if choices == user:
        pay = input ('Please pay : $50')
        
        sales.append(pay)
        
        print('Your '+choices+' will be sent to you soon')
        break
    else:
            print(choices + ': not found in the list')
            break

        
sales?<jupyter_output><empty_output>
StarcoderdataJupyterStructuredCleanDedup