Python Basics Quiz

11 Questions

Settings
Please wait...
Python Basics Quiz

BAsics of Python for our ECA group!


Questions and Answers
  • 1. 
    Type question here. Example: Practice makes you [Blank]
  • 2. 
    In Python, what is one function to output content to the console?
    • A. 

      Echo

    • B. 

      Output

    • C. 

      Print

    • D. 

      Console.log

  • 3. 
    What is the correct way to declare a variable name with value "Chris"
    • A. 

      Name="chris"

    • B. 

      Var name=chris

    • C. 

      Var name="chris"

    • D. 

      Variable name="chris"

  • 4. 
    To make this statement evaluate to true, how will you modify the condition.if ("Oberoi International School".length <=10):     print("A Big name to handle!);
    • A. 

      Change the condition to >=

    • B. 

      Decrease the length of the string

    • C. 

      Change the print statement

    • D. 

      All of the above

  • 5. 
    Screen = pygame.display.set_mode(size)What is the purpose of this statement in the program?
    • A. 

      To specify the size of the window

    • B. 

      To specify the display size

    • C. 

      To set the display

    • D. 

      None of the above

  • 6. 
    If event.type == pygame.QUIT:What does this statement check for?
    • A. 

      Makes the program quit

    • B. 

      Checks for the quit event

    • C. 

      Exits the program

    • D. 

      All of the above

  • 7. 
    Clock.tick(100)The statement
    • A. 

      Sets the clock to use in the program

    • B. 

      Sets the frames per second in a tick of clock

    • C. 

      Checks for clock ticks

    • D. 

      All of the above

  • 8. 
    Which of the following is not a valid assignment operator?
    • A. 

      +=

    • B. 

      -=

    • C. 

      *=

    • D. 

      X=

  • 9. 
    Which one of the following is a valid Python if statement
    • A. 

      If a >= 22:

    • B. 

      If (a >= 22)

    • C. 

      If (a => 22)

    • D. 

      If a >= 22

  • 10. 
    Which of the following is a valid way to start a function in Python?
    • A. 

      Def someFunction():

    • B. 

      function someFunction()

    • C. 

      Def someFunction()

    • D. 

      Function someFunction():

  • 11. 
    Which of the following is a valid way to start a while loop in Python?
    • A. 

      While loop a < 10

    • B. 

      While a < 10:

    • C. 

      While(a < 10)

    • D. 

      While loop a < 10: