I'm a high school computer science teacher, and my original background is in java, jquery, javascript, etc. Not Python. Which I'm required to teach here.
I've been trying to figure out this if/else statement in a larger bit of code, but my lack of knowledge of Python is catching up with me. (Please do not recommend I start with Scratch. The district decided to have it blocked just before the school year started, and I have to teach code.)
The code looks like this (there's more to it if you'd like):
def set_message(students):
if students.sort(reverse=True):
message = "Your students are in reverse order"
else:
message = "Your students are in alphabetical order"
students.sort()
show_students(students, message)
students.sort(reverse=True)
show_students(students, message)
I suspect that if statement is what's getting me here. If you have any ideas, I'd love to hear them and hear why they work.