PythonExamReview(1) - Python exam study guide By convention...

Info icon This preview shows pages 1–15. Sign up to view the full content.

View Full Document Right Arrow Icon
Python exam study guide
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
By convention python scripts are stored as text files with extension? a) a).py .py b) b).p .p c) c).python .python d) d).pyt .pyt 1
Image of page 2
Python is considered an ______ language. a. interpreted b. compiled c. interactive d. composed 2
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
At python language interpreter's prompt, consider >>> 3 3 + + 2 if above input is given and enter is hit then output should be ? a. 2 b. 3 c. 3+2 d. 32 e. 5 f. compiling ..... 3
Image of page 4
What is the output: a. number is greater b. number is less c. number is equal to d. no output will be printed 4 1.number = 99 2.def check_x(): 3. if False : 4. print ( “number is greater" ) 5. elif False : 6. print ( "number is less " ) 7. else : 8. print ( "number is equal to" ) 9. 10.check_x()
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is the output: a. exclamation b. no exclamation c. XLIX d. doesn't print anything 5 x = 49 if x >= 49: print( “XLIX") elif x != 0: print ( "exclamation") else: print ( "no exclamation")
Image of page 6
What is the output: a. exclamation b. no exclamation c. error d. doesn't print anything 6 x = 49 if x != 0: print ( "exclamation") else: print ( "no exclamation")
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is the output: a. Hello World b. Jello World c. Error d. Null 7 >>> greeting = 'Hello World' >>> greeting [ 0 ] = ' J'
Image of page 8
What is the output: a. This will result in an error b. 4 c. 3 d. 1 e. 5 8 x = 1 for i in range ( 2 ): for j in range ( 2 ): x += 1 print (x)
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is the output: 0 0 0 1 1 0 1 1 9 for i in range ( 2 ) : for j in range ( 2 ) : print (i ,j) 0 0 0 1 0 2 1 0 1 1 1 2 2 0 2 1 2 2 0 0 1 1 2 2 0 0 0 1 0 2 1 0 1 1 1 2 a. b. c. d.
Image of page 10
What is the output: (a) 6 (b) 9 (c) 8 (d) 5 10
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is the output: (a) 7 (b) ‘c’ (c) 12 (d) 13 (e) 1 (f) There is a syntax error (g) There is a runtime error 11
Image of page 12
What is the output: (a) 7 (b) ‘c’ (c) 2 (d) 3 (e) 1 (f) There is a syntax error (g) There is a runtime error 12
Image of page 13

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is the output: (a) 7 (b) 2 (c) ‘c’ (d) 3 (e) 1 (f) There is a syntax error (g) There is a runtime error 13
Image of page 14
Image of page 15
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern