Skip to content

Instantly share code, notes, and snippets.

@Yagisanatode
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Yagisanatode/69ef647ca3431854aba2 to your computer and use it in GitHub Desktop.
Save Yagisanatode/69ef647ca3431854aba2 to your computer and use it in GitHub Desktop.
Python 3 - Use In For In Range Loop To Do Differently Occurring Tasks
#! Python 3
'''
Aim: To ping every fifth time in a count while
printing out the count 1 to 20
'''
count = 1
for i in range(0,4):
print ("ping")
for n in range (0,5):
print (count)
count += 1
'''
Result:
ping
1
2
3
4
5
ping
6
7
8
9
10
ping
11
12
13
14
15
ping
16
17
18
19
20
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment