1 / 2

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

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:

kyria
Télécharger la présentation

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

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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()

  2. 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)

More Related