Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

iResearch2

  • 3 years ago

This is the optional problem on secret messages. How do I test for membership in a list? e.g, For c in phrase: If c is in this list [list of upper case alphabet]? #### how to code this line statements I answered my own question -- found it in old lecture notes on the MIT website: ...we can check whether an element is in a list really simply with the in keyword. Something like 'A' in ['A', 'B'] returns True, but 'C' in ['A', 'B'] returns False.

  • This Question is Closed
  1. A.Avinash_Goutham
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    are you talking about python?

  2. iResearch2
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I have closed my question because I answered it myself! ... we can check whether an element is in a list really simply with the in keyword. Something like 'A' in ['A', 'B'] returns True, but 'C' in ['A', 'B'] returns False.

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy