-1

working on a script which is pretty basic where groups of students are being assigned halls to stay in depending on what they are doing and also their age.

if someones course is medical they will be assined to res4.

medical would include dentistry and medicine. Seems to be a bit stuck on printing the hall assigned it should be res4. Thanks in advance.

medical=["dentistry", "medicine"]

course=input("enter course")

while course in medical
    hall=="res4"

    print("enter course", course, hall, )
Aran-Fey
  • 39,665
  • 11
  • 104
  • 149

1 Answers1

0

As stated in the comments you should use == for comparisons. If you check the output of hall=="res4", it will either evaluate to a boolean value or throw a NameError.

You should just use = when assigning values to variables.

hall = "res4"
Jim Wright
  • 5,905
  • 1
  • 15
  • 34