0
if Command == wikiL:
    wikipediaSearch()

That is my code and the list is

wikiL = ['Wiki', 'wiki', 'WIKI', 'wIKI', 'Wikipedia', 'wikipedia', 'WIKIPEDIA', 'wIKIPEDIA']

Is there anyway I can do this because when I try it doesn't do anything

Barmar
  • 669,327
  • 51
  • 454
  • 560
Tropic
  • 11

2 Answers2

1

In Python there is the in operator you just have to do:

if Command in wikil:
     wikipediaSearch()
Mohameth
  • 386
  • 2
  • 9
0

Yes you can do that:

if value in list:
    <then do what you want to do here>
freude
  • 3,292
  • 3
  • 28
  • 48
acrobat
  • 506
  • 3
  • 7