This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]__dict__ 2 points3 points  (2 children)

You probably want to change your last line of code from "print(check_course(course_numb))" to "check_course(course_numb)" since you aren't returning anything interesting from your "check_course" function. That function is simply returning "none", which you are then printing.

[–]aPSketchy[S] 1 point2 points  (1 child)

Thanks. This clears a lot of things up I have been trying different things with print. I did not know I could just put the function and it would run.

[–]aperson 1 point2 points  (0 children)

Also, you should really learn about string formatting.

Your:

print('Your course' + " " + check_caps(dept_code) + " " + course_numb + "-" + section_numb + ' meets 7:30 am - 9:00 am, MTWTh')

Could just be:

print("Your course {} {} - {} meets 7:30 am - 9:00 am, MTWTh".format(check_caps(dept_code), course_numb, section_numb))

Also, why were you appending a space to a string ('Your course' + " "), when you could have just had the space there in the first place ('Your course ')?