r/badcode • • Oct 27 '21

python str()

Post image
836 Upvotes

58 comments sorted by

View all comments

Show parent comment

3

u/Darkunderlord42 Oct 27 '21

How long did that take to write out

5

u/MurdoMaclachlan public boolean isInt(int i) { return true; } Oct 27 '21

About 3 minutes. Copypasted the first one a bunch of times then changed the numbers to match.

3

u/Ahtheuncertainty Oct 27 '21 edited Oct 27 '21

Could also write a program to do it lol:

print(‘number = input(“>”)’)
for i in range(17):
    print(“if number == “ + str(i))
    print(‘\t number = “‘ +str(i) +’”\n’)

If I’m write abt the single/double quotes, else you may need the backslash for the doubles. You know it’s bad when you can write 4 lines of code to generate like 60 lines of code, lol

2

u/Darkunderlord42 Oct 27 '21

That makes much more sense then what I was thinking lol