Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import randint
- A=[7,7,10,4,10,10,5,10,7,10]
- K=20
- def losowy_lider(A):
- for i in range(K):
- x=A[randint(0,len(A)-1)]
- zlicz=0
- for i in range(len(A)):
- if A[i]==x:
- zlicz+=1
- if zlicz>len(A)//2:
- return x
- return "Nie ma lidera"
- print(losowy_lider(A))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement