50 likes | 138 Views
What will the following print out? x = ‘ rachel ’ y = x[0] + x[2] + x[4:] print y rachel rce rcel r+c+el. What will the following print out? x = ‘ evan ’ for y in x: print chr ( ord (y)+1), e v a n f w b o e v a n e v a n n a v e d u z o a e n v.
E N D
What will the following print out? x = ‘rachel’ y = x[0] + x[2] + x[4:] print y • rachel • rce • rcel • r+c+el
What will the following print out? x = ‘evan’ for y in x:print chr(ord(y)+1), • e v a n • f w b o • e v a n e v a n • n a v e • d u z o • a e n v
What will the following print out? num = 12 if num == 12:print ‘a’, elif num == 12 or num == 15print ‘b’, else:print ‘c’ • a • a b • a b c • a c
a a e a e f (error) 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
g q z l m q z q z z l m q z l (error) What will the following print out? for letter in ‘meal’:if letter > ‘g’: print letter,elif letter > ‘d’: print ‘q’,else: print ‘z’,