r/badcode • • Apr 24 '21

python very efficient and scalable code

Post image
1.0k Upvotes

110 comments sorted by

View all comments

104

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

Image Transcription: Code


from tkinter import *
#from tkiner.ttk import *
root = Tk()
genreMenuActive = False
selectedtags = []
def chosetagComedy():
    if 'Comedy' in selectedtags:
        selectedtags.remove('Comedy')
    else:
        selectedtags.append('Comedy')
    print(selectedtags)
def chosetagFantasy():
    if 'Fantasy' in selectedtags:
        selectedtags.remove('Fantasy')
    else:
        selectedtags.append('Fantasy')
    print(selectedtags)
def chosetagAdventure():
    if 'Adventure' in selectedtags:
        selectedtags.remove('Adventure')
    else:
        selectedtags.append('Adventure')
    print(selectedtags)
def chosetagRomance():
    if 'Romance' in selectedtags:
        selectedtags.remove('Romance')
    else:
        selectedtags.append('Romance')
    print(selectedtags)
def chosetagAction():
    if 'Action' in selectedtags:
        selectedtags.remove('Action')
    else:
        selectedtags.append('Action')
    print(selectedtags)
def chosetagDrama():
    if 'Drama' in selectedtags:
        selectedtags.remove('Drama')
    else:
        selectedtags.append('Drama')
    print(selectedtags)
def chosetagFamily():
    if 'Family' in selectedtags:
        selectedtags.remove('Family')

I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!

55

u/KomaedaEatsBagels Apr 24 '21

good human. this code makes me break out in hives