colorful double helix
procoder165 (133)

was bored again in class so I decided to make this.

You are viewing a single comment. View All
pyplacca (1)

Very cool @imnuex
Why don't you use a single print function and set the sep keyword to '\n'. Like this;

print(arg1, arg2, ..., sep='\n')
imnuex (4)

@pyplacca or defining a function then using it as a loop.

pyplacca (1)

@imnuex but then, print still appears more than once for the same purpose. You need to keep the Don't Repeat Yourself principle in mind.
So you could write something like this;

def h():
    print(
        '*'*6, 
        '*'*5,
        '*'*4,
        '*'*3,
        '*'*2,
        '*'*1,
        '*'*1,
        '*'*2,
        '*'*3,
        '*'*4,
        '*'*5,
        '*'*6,
        sep='\n'
    )
while True:
    h()
imnuex (4)

@pyplacca I do remember the DRY principle.

Evanlicious (78)

@imnuex Hey, I made a shortening of your code if you want to see it. I made it more loop based, and I made it so it was not a function. I reduced the number of lines a bit too, not sure if it goes faster though.

https://repl.it/@Evanlicious/Revision-of-a-cool-thing

https://repl.it/@Evanlicious/Revision-of-a-cool-thing

imnuex (4)

@Evanlicious i mean, you can't calculate how much a computer takes to do something

Evanlicious (78)

@imnuex Sometimes there are ways, but yeah, you're probably right.