1- from random import randint , choice
2- import brain_games .sample
1+ import random
2+ from brain_games .sample import gen_rand_num
3+ from brain_games .sample import samples
34
45
56CON_ANSWER = 'What number is missing in the progression?'
67
78
8- def type_brain_progress ():
9- first_num = randint ( 1 , 50 )
9+ def type_brain_progress (numbers ):
10+ first_num , sec_number , arithmetic_operation = numbers
1011 re = []
11- range_progressing = randint (5 , 10 )
12- sec_num = randint (1 , 5 )
12+ range_progressing = random . randint (5 , 10 )
13+ sec_num = random . randint (1 , 5 )
1314 for _ in range (range_progressing ):
1415 re .append (str (first_num ))
1516 first_num += sec_num
16- index_replace_num = re .index (choice (re [1 :]))
17+ index_replace_num = re .index (random . choice (re [1 :]))
1718 replace_num = re [index_replace_num - 1 ]
1819 re .insert (index_replace_num , '..' )
1920 re .remove (re [index_replace_num - 1 ])
@@ -23,8 +24,9 @@ def type_brain_progress():
2324
2425
2526def main ():
26- brain_games .sample .samples (CON_ANSWER , type_brain_progress (),
27- type_brain_progress (), type_brain_progress ())
27+ samples (CON_ANSWER , type_brain_progress (gen_rand_num ()),
28+ type_brain_progress (gen_rand_num ()),
29+ type_brain_progress (gen_rand_num ()))
2830
2931
3032if __name__ == '__main__' :
0 commit comments