Question
In python: 1-Given the declaration circle = Circle(), which of the following statement is most accurate? A-x contains a reference to a Circle object. B-x
In python:
1-Given the declaration circle = Circle(), which of the following statement is most accurate?
A-x contains a reference to a Circle object. B-x contains an int value. C-x contains an object of the Circle type. D- You can assign an int value to x.
2- An object is an instance of a ________.
A- method B- data C-class D- program
3-________ is a state within a class definition.
A- method B- class C- variable D- An object
4-Which one of the following sets default value of radius to 1?
A- def __init__(self):
self.radius = 1
B- def __init__(radius):
radius = 1
C- def __init__(self, radius = self):
self.radius = 1
D- def __init__(self, radius = 1):
self.radius = radius
E- def __init__(self, radius = 1):
self.radius = 1
5-________ is invoked to create an object.
A- A constructor B- The main method C- A method with the void return type D- A method with a return type
6- To instantiate a class, ________
A- Invoke classs constructor. B- Create a method that will call classs constructor. C- Assign an existing object to a variable. D- Import the object from another python program.
7- Which of the following statements is not true?
A- Local variables always get their values from the input arguments. B- You may assign an objects method into any object from different class. C- Two reference variables must reference different objects when objects belong to different class. D- Two reference variables may reference the same object in the memory. If two reference variables value are the same, then these two reference variables are referencing the same object.
8- When invoking a method with an object, ________ must be used.
A- the contents of the object B- the reference of the object C- the class name D- the dot operator
9- Which of the following statement is correct?
A- The randint() method in the random class returns the next random double value. B- The randint() method in the random class can return a random number within a range C- When creating a random object, you have to limit the size of the range to be returned. D- The returning value of randint() method contains in a list.
10- What happened when there is no key matched when we look up a dictionary?
A- Program crashed B- Program displayed no key match C- Program will ask you for a correct key D- Program finds the closest matched key and return the associated value Program returns None
11-When defining a recursive function, which one of the following must be considered?
A- Number of arguments B-Base case C- The position where return statement should be placed D- The data type of argument(s) E- Should have one call to itself within the function definition
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started