A Python paragraph comment uses the style ________.
Practice Python Basics Questions – A Python paragraph comment uses the style ________.
Practice Python Basics Questions – A Python paragraph comment uses the style ________.
Practice Python Libraries Questions – The following code displays ___________.
temperature = 50
if temperature >= 100:
print(“too hot”)
elif temperature <= 40:
print(“too cold”)
else:
print(“just right”)
Practice Class Relationships – What relationship is appropriate for Student and Person?
Practice Lists programming – To shuffle list1, use _______.
Practice while loop Questions – How many times will the following code print “Welcome to Python”?
count = 0
while count < 10:
print(“Welcome to Python”)
count += 1
Practice Sets Programming – Suppose s1 = {1, 2, 4, 3} and s2 = {1, 5, 4, 13}, what is s1 & s2?
Practice Python Basics Questions – In Python, a syntax error is detected by the ________ at _________.
Practice Web Scraping Questions – Invoking the ___________ method converts raw byte data to a string.
Practice File Operations Questions – To open a file c:scores.txt for writing, use __________.
Practice Inheritance Questions – What is the output of the following code?
class ParentClass:
def __init__(self):
self.__x = 1
self.y = 10
def print(self):
print(self.__x, self.y)
class ChildClass(ParentClass):
def __init__(self):
super().__init__()
self.__x = 2
self.y = 20
c = ChildClass()
c.print()
Practice Polymorphism Questions – What will be displayed by the following code?
class A:
def __init__(self):
self.i = 1
def m(self):
self.i = 10
class B(A):
def m(self):
self.i += 1
return self.i
def main():
b = B()
print(b.m())
main()
Practice Strings Questions – Suppose i is 2 and j is 4, i + j is same as _________.
Practice Python Libraries Questions – Analyze the following code:
even = False
if even = True:
print(“It is even!”)
Practice Relational Operators – What is the output of the following code?
x = 0
if x < 4:
x = x + 1
print(“x is”, x)
Practice Python Graphics Questions – To lift the pen, use ___________.