R
R
Roki99992020-05-10 01:30:03
Python
Roki9999, 2020-05-10 01:30:03

Help is needed. Who will help?

I have a list and I have a variable with data. And I need to loop through the list if the data of the variable is found in the list, a certain operation will be performed. How to implement it in Python3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rais, 2020-05-10
@Roki9999

sp = [22,33,44,55]
var = 33
if var in sp:
  print ('Bingo!')

This is of course without type checks
and an error handler.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question