0% found this document useful (0 votes)
30 views3 pages

Exercise Solutions of Python Statements

The document contains sample outputs from practice questions for an exam. It includes the outputs for 12 multiple choice or code snippet questions showing the inputs, processing steps and outputs of each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

Exercise Solutions of Python Statements

The document contains sample outputs from practice questions for an exam. It includes the outputs for 12 multiple choice or code snippet questions showing the inputs, processing steps and outputs of each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

SXCS-IX BT2 Preparation (Outputs)

Answer #1.
iii) 4 + 4/4
iv) (4+4)/4

Answer #2
i)12

ii)13

Answer #3
i)x = 11

ii)x = 80

iii)r = 29

Answer #4
i)
OUTPUT:-
Original 10
Final 12

ii)
OUTPUT:-
Original 100
Final 102

iii)
OUTPUT:-
Final -1

iv)
OUTPUT:-
Final 500

Answer #5
i)
OUTPUT:-
GRADE A
GRADE B
GRADE C

ii)
OUTPUT:-
GRADE C

iii)
OUTPUT:-
GRADE D
GRADE F

iv)GRADE F

1
Answer #7
c c>1 a c-- b --a
4 yes 4 3 7 3
2 yes 5 1 9 4
0 no

OUTPUT:-
<variable c might not be initialized>

Answer #8
c c>1 a c-- b --a
4 yes 4 3 7 3
2 yes 5 1 9 4
0 no

OUTPUT:-
490

Answer #9
c!=4 a OUTPUT a c++
yes 1 1 11 1
yes 11 11 111 2
yes 111 111 1111 3
yes 1111 1111 11111 4
no

FINAL OUTPUT:-[10 times 1]


1111111111

Answer #10
i++<5 i s i++
yes 1 1 2
yes 2 3 3
yes 3 6 4
yes 4 10 5
no

OUTPUT:-
s= 6 i= 4

2
Answer #11
++i ++i<6 x*=i
3 yes 3
4 yes 12
5 yes 60
6 no

The loop executed 3 times.


OUTPUT:-
x= 60 i=6

Answer #12
a x a<x x/=a OUTPUT
5 50 yes 10 10
5 10 yes 2 2
5 2 no

The loop executed 2 times


FINAL OUTPUT:-
10
2

You might also like