I'm having some trouble with this code not working correctly:
class Student:
def __init__(self, full_name, grade_level, grade_1, grade_2, grade_3):
self.name = full_name
self.gl = grade_level
self.grade_1 = grade_1
self.grade_2 = grade_2
self.grade_3 = grade_3
def find_counselor(self, full_name):
fname = list(self.name)
for i in range(len(fname)):
print(i)
if fname[i] == " ":
if fname[i+1] == "A" or "B" or "C" or "D" or "E" or "F" or "G":
print(full_name, "'s counselor is Camille Nix.")
elif fname[i+1] == "H" or "I" or "J" or "K" or "L" or "M" or "N" or "O" or "P":
print(full_name, "'s counselor is Gay Myrick.")
elif fname[i+1] == "Q" or "R" or "S" or "T" or "U" or "V" or "W" or "X" or "Y" or "Z":
print(full_name, "'s counselor is Kerri Curcoe.")
person = Student
person("Bill Taylor", "Sophomore", 99, 99, 99).find_counselor("Bill Taylor")
The first letter of the last name of the student should determine which counselor the student goes to, but no matter what I enter as the name for the student it always returns to me as Camille Nix. I'm not sure why this is happening. Any help is much appreciated.