This repository has been archived by the owner on May 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
4.3.5.Graded Quiz: Objects and Classes
Seongjoo Brenden Song edited this page May 11, 2021
·
1 revision
LATEST SUBMISSION GRADE 100%
class Point(object):
def __init__(self,x,y):
self.x=x
self.y=y
def print_point(self):
print('x=',self.x,'y=',self.y)
-
self.x self.y
-
init
-
print_point
Correct
What is the result of running the following lines of code ?
class Points(object):
def __init__(self,x,y):
self.x=x
self.y=y
def print_point(self):
print('x=',self.x,' y=',self.y)
p1=Points(1,2)
p1.print_point()
-
x=1;
-
x=1 y=2
-
y=2
correct
What is the result of running the following lines of code ?
class Points(object):
def __init__(self,x,y):
self.x=x
self.y=y
def print_point(self):
print('x=',self.x,' y=',self.y)
p2=Points(1,2)
p2.x='A'
p2.print_point()
-
x= 1 y=2
-
x= A y=2
-
x=A, y=B
correct
https://www.coursera.org/professional-certificates/ibm-data-science
© 2021 Coursera Inc. All rights reserved.