What will the following print out? def doit(value ): value = value + 1 print value,

1 / 2

# What will the following print out? def doit(value ): value = value + 1 print value, - PowerPoint PPT Presentation

5 7 7 5 7 8 6 8 8 6 8 9 (nothing). What will the following print out? def doit(value ): value = value + 1 print value, def main(): x = 5 y = 7 doit(x ) doit(y ) doit(y ) main(). What will the following print out? def doit(number ): if number &lt; 5:

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about 'What will the following print out? def doit(value ): value = value + 1 print value,' - kyria

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

5 7 7

5 7 8

6 8 8

6 8 9

(nothing)

What will the following print out?

def doit(value):

value = value + 1

print value,

def main():

x = 5

y = 7

doit(x)

doit(y)

doit(y)

main()

What will the following print out?

def doit(number):

if number < 5:

return ‘small’

else:

return ‘big’

def main():

a = doit(4)

b = doit(7)

print a,

print b,

main()

small big

small big small big

a b

a b a b

(nothing)