GoConqr has a new look! Let us know what you think.

Quiz

Python 3 Quiz 2

Alexandra Brown 12 questions

Take the quiz

Questions in this quiz (12)

  1. 1Which Python keyword is used to return a value from a function back to the statement that called the function?
    1. Aresult
    2. Breturn
    3. Cdef
    4. DNone
  2. 2What is the purpose of the documentation string?
    1. AA documentation string is a comment used to state the general purpose of a function.
    2. BA documentation string prints all of the details of a function on the output string.
    3. CA documentation string is used by the interpreter to determine the number of parameters required.
    4. DA documentation string is needed to register the function with the Python interpreter.
  3. 3Which of the following is a valid first line in the definition of a Python function?
    1. Adef myFunction( ):
    2. BmyFunction( ):
    3. Cdef myFunction( )
    4. DmyFunction( )
  4. 4Which of the following lines of code will create a Car object named, myCar?
    1. AmyCar = Car
    2. BmyCar = Car()
    3. CCar myCar
    4. DCar(myCar)
  5. 5Which of the following statements is correct regarding the relationship between classes and objects?
    1. AA class and an object both describe the exact same thing.
    2. BAn object is a blueprint that is used to create individual classes.
    3. CA class is a blueprint that is used to create individual objects.
    4. DObjects refer to blueprints created for real worlds things, while classes refer to blueprints created for programming concepts.
  6. 6Which of the following could be the first line of code for the class called, Employee?
    1. Aclass Employee:
    2. Bdef class Employee:
    3. Cclass Employee(self):
    4. Ddef class Employee(self):
  7. 7Which of the following lines of code will create a Canvas widget that is 100 pixels wide, 300 pixels tall, and has red as the background color?
    1. AmyCanvas = Canvas(width=100, height=300, bg="red")
    2. BmyCanvas = Canvas(width=100, height=300, bg=red)
    3. CmyCanvas = Canvas(100, 300, bg="red")
    4. DmyCanvas = Canvas(100 300 "red")
  8. 8Which of the following lines of code starts a class named Car that inherits from the class Vehicle?
    1. Aclass Car() inherits from Vehicle:
    2. Bclass Car( ): Vehicle( ):
    3. Cclass Car(Vehicle):
    4. Dclass Vehicle(Car):
  9. 9Which of the following lines of code creates a square staring at (10, 10), where each side has length15?
    1. AmyCanvas.create_rectangle(10, 10, 25, 25)
    2. BmyCanvas.create_rectangle(10, 10, 15, 15)
    3. CmyCanvas.create_rectangle(10, 10, 15)
    4. DmyCanvas.create_square(10, 10, 15)
  10. 10Which of the following characters encloses the values of a tuple?
    1. A( )
    2. B[ ]
    3. C{ }
    4. D< >

Information

Description
10th grade Computer Science Quiz on Python 3 Quiz 2, created by Alexandra Brown on 30/10/2018.
Language
English
Views
1
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?