How to take in the first value of a string when multiple are presented

0 votes

keyWord = ["urgent", "Linux", ...]

val = input("Enter the text for the ticket: ").casefold()
if "urgent".casefold() in val:
    print("Keyword: " + keyWord[0])
    print("Route to: Pry Ority")
elif "Linux".casefold() in val:
    print("Keyword: " + keyWord[1])
    print("Route to: Pebble Penguin")
elif...


If the user is prompted and they type "urgent linux" I would like it to return the first keyword of the string urgent and route to Pry Ority.
Sep 25, 2022 in Python by Edureka

edited Mar 4, 2025 327 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP