Using range function as sequence

for i in range(6,20[,2]):
    print(i)

While running this code I am expecting that I should get output as:
6
8
10
12
14
16
18
But python notebook on Google Colaboratory is giving me syntax error. What is wrong in this code?

for i in range(6,20,2):
print(i)

2 Likes