File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -446,7 +446,7 @@ ABd1234@1
446
446
In case of input data being supplied to the question, it should be assumed to be a console input.
447
447
448
448
** Solution:**
449
- <pre >:
449
+ <pre >
450
450
import re
451
451
value = []
452
452
items=[x for x in raw_input().split(',')]
@@ -493,7 +493,7 @@ In case of input data being supplied to the question, it should be assumed to be
493
493
We use itemgetter to enable multiple sort keys.
494
494
495
495
** Solution:**
496
- <pre >:
496
+ <pre >
497
497
from operator import itemgetter, attrgetter
498
498
499
499
l = []
@@ -515,15 +515,14 @@ Define a class with a generator which can iterate the numbers, which are divisib
515
515
Consider use yield
516
516
517
517
** Solution:**
518
- <pre >
518
+ <pre >
519
519
def putNumbers(n):
520
520
i = 0
521
521
while i<n:
522
522
j=i
523
523
i=i+1
524
524
if j%7==0:
525
525
yield j
526
-
527
526
for i in reverse(100):
528
527
print i
529
528
</pre >
@@ -551,7 +550,7 @@ Then, the output of the program should be:
551
550
In case of input data being supplied to the question, it should be assumed to be a console input.
552
551
553
552
** Solution:**
554
- <pre >
553
+ <pre >
555
554
import math
556
555
pos = [0,0]
557
556
while True:
You can’t perform that action at this time.
0 commit comments