What again does the "in" command/operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What again does the "in" command/operator?

Sorry for the basic question but it seems impossible to search for a small word like "in"!

29th Aug 2018, 2:38 PM
Tom Riddle
Tom Riddle - avatar
4 Answers
+ 10
the in command checks to see if a certain variable is in a string or list or something else. a = "0" string = "079844325889" if a in string: print("yes") else: print("no")
29th Aug 2018, 2:47 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 9
Tom Riddle no problem
29th Aug 2018, 2:50 PM
LONGTIE👔
LONGTIE👔 - avatar
+ 3
Thanks a lot! Really helped!
29th Aug 2018, 2:49 PM
Tom Riddle
Tom Riddle - avatar
+ 2
Tom Riddle I have a code for "in" in loops, check it out https://code.sololearn.com/ckYo5k5111Dm/?ref=app
30th Aug 2018, 12:23 PM
I Am Arthur
I Am Arthur - avatar