Types of Loops (That I Use) 03-09-2014, 05:18 AM
#1
This is just a list of loops that I do, maybe you guys could use these loops in your Python Programming and such.
The "Forever" Loop:
This is a really simple loop.
Basically, you have loop2 to do functions and such or whatever you want it to do and it automatically goes to loop1, which goes back to loop2.
The Prompt Loop:
Basically you just prompt the user if they want to continue. Depending on their response, it may or may not loop. However, this isn't necessarily a loop since it isn't always used as a loop.
This loop checks what number or whatever the fuck in the range and prints it. It doesn't have to print it, this is useful, very.
An example of other uses would be in my Cheerio-Shitter DoS tool.
These are the loop-types that I use, and what they do. Maybe this was helpful for you, it does have a learning aspect, so don't say it doesn't teach you anything.
The "Forever" Loop:
This is a really simple loop.
Code:
def loop1():
loop2()
def loop2():
loop1()Basically, you have loop2 to do functions and such or whatever you want it to do and it automatically goes to loop1, which goes back to loop2.
The Prompt Loop:
Basically you just prompt the user if they want to continue. Depending on their response, it may or may not loop. However, this isn't necessarily a loop since it isn't always used as a loop.
Code:
def loop():
shithere
_input = input('Do you want to continue?')
if _input == 'y':
loop()
elif _input == 'n':
print('Bye!')
else:
print('Unknown response')
[color=#FF0000]The For Loop:[/color]
This is probably one of the most known, and one of the most least used (by me) loops.
[code]
for flafjkgafjkhg in range(1,99):
print('We're on number {0}'.format(flafjkgafjkhg))This loop checks what number or whatever the fuck in the range and prints it. It doesn't have to print it, this is useful, very.
An example of other uses would be in my Cheerio-Shitter DoS tool.
Code:
instances = random.randint(50,500)
for i in instances(1,instance):
dos()These are the loop-types that I use, and what they do. Maybe this was helpful for you, it does have a learning aspect, so don't say it doesn't teach you anything.
![[Image: BXqGARG.png]](https://i.imgur.com/BXqGARG.png)










![[+]](https://sinister.li/images/modern/collapse_collapsed.png)











tart![[Image: jWSyE88.png]](http://i.imgur.com/jWSyE88.png)









![[Image: R5aCcWV.png]](http://i.imgur.com/R5aCcWV.png)