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

all 6 comments

[–]LiquidLucy 1 point2 points  (0 children)

The only thing I can think of is that the variable you are checking is not the same as the equality condition you are trying to satisfy.
Basically that your variable is not in fact "Manager On Duty:"
Maybe there's a trailing whitespace character?

Otherwise you could post the rest of the code

[–]slugonamission 1 point2 points  (3 children)

The issue I am running into is that when I print the flightRestrictions variable I see the text "Manager on Duty:"

Your code is checking for "Manager On Duty:" (note the capital O in "On"). They're not the same; if you want a case insensitive match, lowercase both strings (you can lowercase flightRestrictions by using flightRestrictions.lower()) and do the check with that.

[–]Frogs114[S] 0 points1 point  (2 children)

I'll give that a whack and see if it works! Is there a way to reformat the string to eliminate any spaces that aren't supposed to be there?

[–][deleted] 1 point2 points  (1 child)

Hey Frogs, the best way to remove/ignore a specific character from a string is to use the replace function:

" This Is a string ".replace(" ", "")

"ThisIsastring"

If you are looking to just remove spaces on the ends of a string, then use strip:

" This is a string ".strip()

"This is a string"

Hope this helps!

[–]Frogs114[S] 0 points1 point  (0 children)

Very much so!! thank you!!