Skip to content

Commit 91d319f

Browse files
committed
fixed
1 parent 079f5da commit 91d319f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

task_2.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33

44
def get_numbers_ticket(min, max, quantity):
5-
if not 1 <= min <= max <= 1000 and quantity > (max - min + 1):
6-
return []
7-
8-
random_numbers = random.sample(range(min, max + 1), quantity)
9-
random_numbers.sort()
10-
return random_numbers
5+
if 1 <= min <= max <= 1000 and quantity <= (max - min):
6+
random_numbers = random.sample(range(min, max), quantity)
7+
random_numbers.sort()
8+
return random_numbers
9+
return []
1110

1211

1312
lottery_numbers = get_numbers_ticket(1, 49, 6)

0 commit comments

Comments
 (0)