-
a) Output:
10
-
b) Output:
Inspirational stores \n for \t Children
-
c) Output:
sum= 28
-
d) Output:
i= 55
& in next linesum= 125
-
e) Output:
error
ORLeap Year
(if i in line 2 is changed to y)
-
a) 9 times -->
100, 90, 80, 70, 60, 50, 40, 30, 20
-
b) 5 times -->
100, 120, 140, 160, 180
-
c) 2 times -->
1, 10
-
d) infinite loop -->
4, 14, 24, 34, 44, 54, 64, ...
-
e) infinite loop -->
2, 2, 2, 2, 2, ...
-
a)
a=25 <next line> while a<500: <next line> print a <next line> a=a+25
-
b)
a=90 <next line> while a>9: <next line> print a <next line> a=a-9
-
a)
for i in range(10,250,50): <next line> print i
-
b)
for i in range(88,7,-8): <next line> print i
int(x)
orfloat(x)
can be used to convert text into integer value.
-
a)
Error: name 'a' is not defined.
-
b)
Invalid Syntax
(for i in range is to be used. -
c)
Invalid Syntax
Indentation issue. -
d)
Invalid Syntax
Indentation issue & wrong placement of ":"
-
print L1
will print[300, 400]
-
print L2
will print[200, 300, 400, 500]
-
print L2
(afterL2.extend(L1)
code) will print[200, 300, 400, 500, 300, 400]