Advertisement
simonedare_

Untitled

Nov 22nd, 2021
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. numbers = [4,7,11,3,5]
  2. found = False
  3. counter = 0
  4. # check if num > 10 is inside the array
  5. while(found == False and counter < len(numbers)):
  6.     if(numbers[counter] > 10):
  7.         found = True
  8.     else:
  9.         counter = counter + 1
  10.    
  11. print("Trovato:", found)
  12. if found == True:
  13.     print(numbers[counter])
  14.  
  15. # && = and
  16. # || = or
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement