Presentation is loading. Please wait.

Presentation is loading. Please wait.

What will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y A.rachel B.rce C.rcel D.r+c+el.

Similar presentations


Presentation on theme: "What will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y A.rachel B.rce C.rcel D.r+c+el."— Presentation transcript:

1 What will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y A.rachel B.rce C.rcel D.r+c+el

2 What will the following print out? x = ‘evan’ for y in x: print chr(ord(y)+1), A.e v a n B.f w b o C.e v a n e v a n D.n a v e E.d u z o F.a e n v

3 What will the following print out? num = 12 if num == 12: print ‘a’, elif num == 12 or num == 15 print ‘b’, else: print ‘c’ A.a B.a b C.a b c D.a c

4 What will the following print out? num = 12 if num == 12: print ‘a’, elif num == 12 or num == 15: print ‘b’, else: print ‘c’ if num == 27: print ‘d’, elif num == 19 or num == 12: print ‘e’ print f A.a B.a e C.a e f D.(error)

5 What will the following print out? for letter in ‘meal’: if letter > ‘g’: print letter, elif letter > ‘d’: print ‘q’, else: print ‘z’, A.g q z l B.m q z q z z l C.m q z l D.(error)


Download ppt "What will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y A.rachel B.rce C.rcel D.r+c+el."

Similar presentations


Ads by Google