An Annoying Thing
Wilke000 (345)

It's very annoying!
I just thought of making it...

I want to thank @LizFoster and @ChezTacoz for helping me with while loops

You are viewing a single comment. View All
ChezTacoz (246)

It's very interesting but for future reference you can just use a while loop

Wilke000 (345)

ok @ChezTacoz but i dont really know while loops :(

LizFoster (592)

@IndyCarter to do a while loop for this, all you have to say is:

while True:
print("1234567890987654321")
input("Hi, my name is Bob")
print('jdfksdjljdsldskljgfkdguery57rtuihgrfjkdtueiytuiihgglfhufghxuigxfhjgfjfkdhdf')
input('I dont know what that means... do you?')
print('(Click Enter)')

Indent everything past the 'while True:' part

hope this helps ^ ^*

Wilke000 (345)

question @LizFoster ...what does that do?

LizFoster (592)

@IndyCarter a while loop basically just goes over a few lines of code over and over again until some kind of condition is fulfilled! In this case, saying 'while True:' makes it so that it will loop forever.

Wilke000 (345)

ok thank u @LizFoster !
But how do you make it say
(dont click enter)
ERROR!!!! ERROR!!!!
........
at the end?

LizFoster (592)

@IndyCarter well, how many times do you want it to loop before saying that? it'll be easier if i write it as a program and send you a link.

LizFoster (592)

@IndyCarter for however many loops you want, just set the count variable to that number:
https://repl.it/@LizFoster/Annoying-Machine

Wilke000 (345)

ok thank u @LizFoster
I will (and have)

nt998302 (159)

@LizFoster you can do single line while loops...

while True: print(); print
#xD
LizFoster (592)

@nt998302 Ah, good point. I'm just not a fan of them, since they are harder to read when you have a lot of things to loop over.

nt998302 (159)

@LizFoster Yea. One time I had to do an assignment in 10 lines for bonus credit, but I put all the if/else statements on one line and I finished in 7 lines xD