Advertisement
Matvey_Borisov

Untitled

Oct 22nd, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. import random
  2. print("Length of arrays is:")
  3. n=int(input())
  4. print("found number is:")
  5. f=int(input())
  6. founded=0
  7. arr1=list(range(n))
  8. arr2=list(range(n))
  9. arr3=list(range(n))
  10. for i in range(n):
  11.     if i<n/2:
  12.         arr1[i]=0
  13.     else :
  14.         arr1[i]=1
  15.     if i%2==0:
  16.         arr2[i]=0
  17.     else :
  18.         arr2[i]=1
  19.     arr3[i]=random.randint(1,99)
  20.     if arr3[i]==f:
  21.         founded=1
  22. print(arr1)
  23. print(arr2)
  24. print(arr3)
  25. if founded==1:
  26.     print("found number is founded")
  27. else :
  28.     print("found number is not founded")
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement