mardi 27 juillet 2021

Uncalled function running when variable is outside, but doesn't run unless called when variable is inside

if you reference configtype inside of configselect() then the function wont run unless called, however when configtype is referenced outside of configselect() then the input() function will run and no values will be returned.

what do yall think is going on here?

import os

configtype = int(input("Are you configuring a (1)962, (2)Audience, or (3)mAP? "))

def configselect():
    if configtype == 1:
        print("you chose 962")
    elif configtype == 2:
        print("you chose Audience")
    elif configtype == 3:
        print("you chose mAP")
    else:
        print("Try again dummy")

Aucun commentaire:

Enregistrer un commentaire