Python Programming Module 1: Quiz!

10 Questions | Total Attempts: 423

SettingsSettingsSettings
Python Programming Module 1: Quiz! - Quiz

.


Questions and Answers
  • 1. 
    The following Python code – >>> 2.0 + 2
    • A. 

      0.4

    • B. 

      2.2

    • C. 

      4.0

    • D. 

      An error: You need to make a conversion between a float and an integer

    • E. 

      None of the above

  • 2. 
    Which of the following is true of Python but not of C or Java?
    • A. 

      Indentation is used for block statements.

    • B. 

      Line breaks are used to end a statement.

    • C. 

      Only two forms of looping are used.

    • D. 

      All of the above

    • E. 

      None of the above  

  • 3. 
    What is the order of operation is Python?
    • A. 

      PEMDAS rule

    • B. 

      BODMAS rule

    • C. 

      Both a&b

    • D. 

      None of the above

  • 4. 
    What is the output of >>> 5.5=5?
    • A. 

      5

    • B. 

      Syntax Error: can't assign to literal

    • C. 

      2.5

    • D. 

      4

  • 5. 
    What is the output of the following program? >>> word = 'abcdefghij' >>> print (word[:3] + word[3:])
    • A. 

      Abcdefg

    • B. 

      Abcabc

    • C. 

      Abchij

    • D. 

      Abcdefghij

  • 6. 
    What is the output of the below program? >>> a = [4,7,3,2,5,9] >>> a[-2]  
    • A. 

      7

    • B. 

      5

    • C. 

      Error

    • D. 

      2

  • 7. 
    What is the output of the below program? >>> 'abc' * 3
    • A. 

      Abc * 3

    • B. 

      Abcabcabc

    • C. 

      Error

    • D. 

      None of the above

  • 8. 
    What is the output of the below program? >>> S = "NCR Gurgaon" >>>  S[1:5]
    • A. 

      NCR

    • B. 

      CR G

    • C. 

      CR

    • D. 

      None of the above

  • 9. 
    Which of the following statements is true?
    • A. 

      Python is a high level programming language.

    • B. 

      Python is an interpreted language.

    • C. 

      Python is an object-oriented language.

    • D. 

      All of the above.

  • 10. 
    What is used to define a block of code (body of loop, function etc.) in Python?
    • A. 

      Curly braces

    • B. 

      Parenthesis

    • C. 

      Indentation

    • D. 

      Quotation

Related Topics
Back to Top Back to top