Open Joshua-Burt opened 5 years ago
The solution should be
print(random.sample(range(100, 201), 5))
Since 200 should be included in the output, your solution forgot that range stop is n-1
Thank you,Joshua-Burt and ticktaktoe33 for pointing this out,made a PR regarding the issue.
https://github.com/zhiwehu/Python-programming-exercises/blob/22bb9b343f009a1d710117b02f5b278e0761094f/100%2B%20Python%20challenging%20programming%20exercises.txt#L1942
https://github.com/zhiwehu/Python-programming-exercises/blob/22bb9b343f009a1d710117b02f5b278e0761094f/100%2B%20Python%20challenging%20programming%20exercises.txt#L1953
The solution shown is
print(random.sample(range(100), 5))
However that will only generate numbers between 0 and 100, but the question asks for 100 to 200.
The solution should be
print(random.sample(range(100, 200), 5))