def wish_happy_holiday(holiday_name):
    return "Happy %s!" % (holiday_name)
    
def wish_happy_holiday2(holiday_name):
    return "Happy " +  holiday_name + "!"
    
################################################################################

def print_first_half(L):
    for i in range(len(L)//2):
        print(L[i])

################################################################################

        
        
def h():
    global trick
    trick = "trick"
    return "treat"
    
trick = "midterm"
treat = "exam"
treat = h()
print(trick + " or " + treat) #should print "trick or treat"

################################################################################

x = 3
y = x - 2
y += (x + y)
x = 7
print(x, y)   #7 5

################################################################################

def count_engineers(costumes):
    total = 0
    for costume in costumes:
        if costume == "engineer":
            total += 1
            
    return total
    
################################################################################

def smallest_factor(n):
    for i in range(2, n): 
        if n % i == 0:
            return i
    return n #n doesn't have factors smaller than itself
        

print(smallest_factor(272483))  


#or, if you happen to be good at factoring, another acceptable answer is:
print(521)   # :-)

################################################################################

def switch_columns(M, i, j):
    for row in range(len(M)):
        M[row][i], M[row][j] = M[row][j], M[row][i]
        

################################################################################

        











    
                    