0

I want to allow certain characters to a string
For example I want

strA to contain either 'A' or 'B' or 'C' or 'D'

How do I do that, help would be greatly appreciated.

Thanks

strA = 'A' or 'B' or 'C' or 'D'

Edited by mms6: n/a

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by mms6
1

I want to allow certain characters to a string
For example I want

strA to contain either 'A' or 'B' or 'C' or 'D'

How do I do that, help would be greatly appreciated.

Thanks

strA = 'A' or 'B' or 'C' or 'D'

Your questions are soooo vague. Could you please post what code you have? Giving us a example input/output never hurt either! I feel like I anwsered this question from you in the last 24 hours.

Votes + Comments
Very nice guy. Takes time to help out
0

sorry

I mean like if I input either A, B, C, or D into python shell

I would get like True

if I enter R or some other letter or number or character
I would get False

Thanks

0

I figured it out using a dumb way stating all conditions with boolean operators lol
Your way is much nicer, thanks a bunch.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.