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
  • 741,623
  • 53
  • 500
  • 612
Tropic
  • 11

2 Answers2

1

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

if Command in wikil:
     wikipediaSearch()
Mohameth
  • 376
  • 2
  • 10
0

Yes you can do that:

if value in list:
    <then do what you want to do here>
freude
  • 3,632
  • 3
  • 32
  • 51
acrobat
  • 812
  • 4
  • 7