Every line of 'randint without replacement' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.
9 def with_replacement(samples): 10 total = 0 11 12 for i in range(samples): 13 a = random.randint(1, 10) 14 b = random.randint(1, 10) 15 c = a + b 16 total += c 17 18 avg = total / samples 19 return avg
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code