what will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y a.rachel b.rce...

5
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

Upload: helen-norris

Post on 18-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

What will the following print out?x = ‘rachel’y = x[0] + x[2] + x[4:]print yA. rachelB. rceC. rcelD. r+c+el

What will the following print out?x = ‘evan’for y in x:

print chr(ord(y)+1),A. e v a nB. f w b oC. e v a n e v a nD. n a v eE. d u z oF. a e n v

What will the following print out?num = 12if num == 12:

print ‘a’,elif num == 12 or num == 15:

print ‘b’,else:

print ‘c’A. aB. a bC. a b cD. a c

What will the following print out?num = 12if 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. aB. a eC. a e fD. (error)

What will the following print out?for letter in ‘meal’:

if letter > ‘g’:print letter,

elif letter > ‘d’:print ‘q’,

else:print ‘z’,

print

A. g q z lB. m q z q z z lC. m q z lD. (error)