I need to make a random selection of two arguments with a percentage For example, variable a(like) has a 82.5% chance of falling out, and variable b(dislike) has a 17.5% chance
But in case neither "a" nor "b" can be made, the variable "c" is triggered
a = keyboard.send("LEFT")
`enter code here`b = keyboard.send("RIGHT")
amount_like = 20
while amount_like<=0:
if random.choices(['a','b','a','a']) <= 0:
if likes(a):
amount_like -= 1
print('Лайк сделан...')
sleep(1)
elif dislikes(b):
keyboard.send("LEFT")
print('Дизлайк отправлен...')
sleep(1)
else:
print('Матч скипнут...')
elif amount_like() <=0:
print('Успех')
else:
print('Цикл окончен, лайков осталось =', amount_like)
There is some error in my code, it does not want to subtract when the variable a (like) drops out
Aucun commentaire:
Enregistrer un commentaire