I am not sure on how to ask this question, i have searched but no results. Please help.
How can I make an if statement which will repeat itself every four times insede a for loop:
for x in range(0,20):
print x
if x >= 3:
print ","
As you can see here I want the comma to reap evry four numbers and instead i get this:
0
1
2
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
.
.
.
Since the numbers ahead of 3 are greater than 3. I am on python. Please help me.
Aucun commentaire:
Enregistrer un commentaire