Quote:
please explain to me where did I go wrong.
The problem is that you need to learn Python syntax.
This just doesn't exist:
if key_data in stu_enrol:
print("Successfully enrolled.")
elif:
print("Sorry you need to enrol in at least two courses")
elif:
print("Sorry, already enrolled in that course")
elif:
print("Sorry, that course does not exist.")
else:
print("Sorry, a maximum of four courses are allowed")
[Update]
Your updated code is better, but there is still a huge error:
replace
if key_data in stu_enrol:
print("Successfully enrolled.")
elif(key_data != add_course ):
print("Sorry you need to enrol in at least two courses")
elif(key_data != stu_enrol):
print("Sorry, already enrolled in that course")
elif(key_data != CourseCode):
print("Sorry, that course does not exist.")
else(key_data != max):
print("Sorry, a maximum of four courses are allowed")
with
if key_data in stu_enrol:
print("Successfully enrolled.")
elif(key_data != add_course ):
print("Sorry you need to enrol in at least two courses")
elif(key_data != stu_enrol):
print("Sorry, already enrolled in that course")
elif(key_data != CourseCode):
print("Sorry, that course does not exist.")
else(key_data != max):
print("Sorry, a maximum of four courses are allowed")