mardi 4 août 2020

Why is this if else statement not continuing?

So I set up this function to go through each question being provided with a y or n (yes or no) or to reask if not one of the two options.

My issue with the code is that it does not continue past the first question. Is there a way to get this code to continue following this style?

def accessory():
  global multi
  Fer = input("Is there Ferrite? (y/n): ").upper
  if Fer == 'Y':
    FerC = input("Is there full coverage? (y/n): ").upper
    if FerC == 'Y':
      multi += 1.5
    elif FerC == 'N':
      multi += 0.5
    else: 
      accessory()
  elif Fer == 'N':
    print(" ")
  else:
    accessory() 

accessory() 

Aucun commentaire:

Enregistrer un commentaire