same logic used in java doesn't work in python : i'm a beginner and i've been practicing a little bit doing the exercises on this website : **http://www.w3resource.com/python-exercises/python-conditional-statements-and-loop-exercises.php**

My question concerns exercise #19 where the following is asked :
 
[enter image description here][1]

I actually run the same logic mentioned bellow on Java and it worked ! i can't understand why it won't work in python :/ 

import os

List = [0,1,2,3,4,5,6]

for i in List:

	if i==0 or i==6:
		for j in range(1,5):
			print "*",
		print("")
	if i==3:
		for k in range(1,4):
			print "*",
		print("")
	else:
		print "*",


print("")

os.system("pause")

THANK YOU ALL ! :)


  [1]: https://i.stack.imgur.com/CzvxM.png