File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,10 @@ def is_lucky_number(number):
99 'Angka Lucky'
1010 >>> is_lucky_number(21)
1111 'Angka Lucky'
12+ >>> is_lucky_number(9)
13+ 'Angka Lucky'
14+ >>> is_lucky_number(10)
15+ 'Bukan Angka Lucky'
1216 >>> is_lucky_number(1232)
1317 'Bukan Angka Lucky'
1418 >>> is_lucky_number(700)
@@ -21,7 +25,8 @@ def is_lucky_number(number):
2125 idx = 1
2226 nbr = []
2327 for i in range (1 , MAX_NUMBER ):
24- nbr .append (i )
28+ if i % 2 != 0 :
29+ nbr .append (i )
2530
2631 while idx < len (nbr ):
2732 step = nbr [idx ]
@@ -50,6 +55,8 @@ def main(args=None):
5055
5156 print (is_lucky_number (1 )) # Angka Lucky
5257 print (is_lucky_number (21 )) # Angka Lucky
58+ print (is_lucky_number (9 )) # Angka Lucky
59+ print (is_lucky_number (10 )) # Bukan Angka Lucky
5360 print (is_lucky_number (80 )) # Bukan Angka Lucky
5461 print (is_lucky_number (897 )) # Bukan Angka Lucky
5562
You can’t perform that action at this time.
0 commit comments