Python_Midterm1_Fall2012.pdf - Name NetID Python&Midterm#1...

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

Name: Python Midterm #1 NetID: Fall 2012 1. Is the following expression True or False? False == False A. True B. False 2. The following expression is. .. 10 <= 10 A. True B. False C. None 3. Assuming a user enters "28" as their favorite number, what is the output of the following program? num = input("Please enter your favorite number") if num == 28: print("that's the number of days in February during a nonBleap year.") elif num == "28": print("that's a very nice cucumber.") else : print("whoops!") 4. What does the following statement output? print(str(int("10.2") < 20 – 1))
Image of page 1

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

Name: Python Midterm #1 NetID: Fall 2012 5. What does this evaluate to? ((3 + 5 B (2 / 2)) / 7) + 1 6. What does theOther hold? this = True that = False theOther = (not this) or (that and not this) A. this B. that C. True D. False 7. If we wanted this code to output the numbers 4, 6, 8, what would we put in the blanks spots?
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '15
  • Tom Schmidt

{[ 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