While writing some code for a class, it gave this error and I don't know how to fix it as I personally do not see any issues with what it is addressing
traceback (most recent call last): File "C:\Users\Daniel Benotti\Desktop\School\Benotti_Daniel student Ed loop with functions.py", line 50, in main() File "C:\Users\Daniel Benotti\Desktop\School\Benotti_Daniel student Ed loop with functions.py", line 9, in main TotCurr, TotCe = loop(TotCurr, TotCe, again) File "C:\Users\Daniel Benotti\Desktop\School\Benotti_Daniel student Ed loop with functions.py", line 21, in loop TotCurr, TotCe, studType = calc(studNum, TotCurr, TotCe) File "C:\Users\Daniel Benotti\Desktop\School\Benotti_Daniel student Ed loop with functions.py", line 34, in calc if studNum > STUD_NUMBER: TypeError: '>' not supported between instances of 'str' and 'int'`enter code here`
this is the code that follows
STUD_NUMBER = 2500
def main():
TotCurr, TotCe, again = init()
TotCurr, TotCe = loop(TotCurr, TotCe, again)
dispTot(TotCurr, TotCe)
def init():
TotCurr = 0
TotCe = 0
again = "Y"
return TotCurr, TotCe, again
def loop(TotCurr, TotCe, again):
while again.upper() == "Y":
firstName, lastName, studNum = getInput()
TotCurr, TotCe, studType = calc(studNum, TotCurr, TotCe)
dispDetail(studType)
again = input("Do you want to add another student record? (Y/N): ")
print()
return TotCurr, TotCe
def getInput():
firstName = input("please enter students first name: ")
lastName = input("please enter students last name: ")
studNum = input("please enter the student ID number: ")
return firstName, lastName, studNum
def calc(studNum, TotCurr, TotCe):
if studNum > STUD_NUMBER:
studType = "Curriculum"
TotCurr += 1
else:
studType = "Continuing Education"
TotCe +=1
return TotCurr, TotCe, studType
def dispdetail(studType):
print("This student is currently in the", studType, 'course')
print()
def dispTot(TotCurr, TotCe):
print("Total students in Cuuriculum course", TotCurr)
print("Total students in Continuing education course", TotCe)
main()
enter code here