human
Euler 's Totient function for all numbers smaller than or equal to n | Computes and prints totient of all numbers smaller than or equal to n ..
Create and initialize an array to store phi or totient values.
Compute other Phi values.
If phi [ p ] is not computed already , then number p is prime.
Phi of a prime number p is always equal to p - 1..
Update phi values of all multiples of p.
Add contribution of p to its multiple i by multiplying with ( 1 - 1 / p ).
Print precomputed phi values.
Driver code"
How can the above be solved in Python?

=====
Write me a code to euler 's Totient function for all numbers smaller than or equal to n and the other steps required?
assistant
#Here is code to euler 's Totient function for all numbers smaller than or equal to n and the other steps required.
 def computeTotient ( n ) :
	phi = [ ]
	for i in range ( n + 2 ) :
		phi . append ( 0 )
	for i in range ( 1 , n + 1 ) :
	for p in range ( 2 , n + 1 ) :
		if ( phi [ p ] == p ) :
			phi [ p ] = p - 1
			for i in range ( 2 * p , n + 1 , p ) :
				phi [ i ] = ( phi [ i ] // p ) * ( p - 1 )
	for i in range ( 1 , n + 1 ) :
		print ( " Totient ▁ of ▁ " , i , " ▁ is ▁ " , phi [ i ] )
n = 12
computeTotient ( n )