Untitled
Anonymous
plain_text
08/04/2024 1:49 PM
464 B
13
Indexable
import random
# Number of attempts
num_attempts = 10
# Probability of success
success_probability = 0.1
# Record the results
results = []
for attempt in range(1, num_attempts + 1):
if random.random() < success_probability:
results.append((attempt, "Success"))
else:
results.append((attempt, "Failure"))
print(results)
Editor is loading...
Leave a Comment