Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Constructive Criticism

Name: xpoferens 2009-03-28 0:47

These tutorials make me do such basic shit, so I decided to do my own thing and copy some built in functions. Here's my first attempt at a range function. From lurking around here I've learnt that there are many ways to do the same thing, and some ways are more efficient than others. Am I doing this the complete noob way? Is there a more efficient way?

def myrange(a, b, c):
    while True:
        if b == 0:
            print('incorrect b value')
            break
        else:
            i = a
            a += b
            if abs(a) > abs(c + b):
                break
            else:
                print(i)
                continue
                print(a)
                       
       
myrange(1, 1, 10)

#Im pretty proud of my work, considering the time I have been programming, but I want to learn to be better, so any constructive criticism is welcome. If you guys want me to stop posting n00b programs tell me and I will stop.

Name: Anonymous 2009-03-28 0:54

I'm going to be honest and say I was going to critique you and provide a far superior one version but I honestly can't figure out what the fuck that is supposed to be doing, particularly given it is finding something to do with a range?

The program, if and only if |a| > |c| and b!=0, prints a followed by a+b. How in gods name does this relate to a range?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List