for i in range(4, 10, 2):
print(i)
in the above code, range has 3 parameters :
- Start of Range (inclusive)
- End of Range (Exclusive)
- Incremental value
For more clarity refer below for the java representation of above
python code:
for (int i=0; i<10; i+=2){
System.out.println(i)
}