Consider the list my_list = [‘www’, ‘python’, ‘org’] . Choose the option that returns ‘www.python.org’ as the value to my_string.
Category: Uncategorized
What is the length of the dictionary my_dict = {‘Country’:’I…
What is the length of the dictionary my_dict = {‘Country’:’India’, ‘State’: {‘City’:’Delhi’, ‘Temperature’:40}} ?
Choose the print statement that generates [‘a’, ‘d’] as the…
Choose the print statement that generates [‘a’, ‘d’] as the output for my_list = [‘a’, ‘b’, ‘c’, ‘d’, ‘e’, ‘f’, ‘g’] .
Which of the following statements is incorrect for python di…
Which of the following statements is incorrect for python dictionaries?
What is output? objects = {}objects[‘a’] = ‘Chair’objects[‘…
What is output? objects = {}objects[‘a’] = ‘Chair’objects[‘b’] = ‘Table’objects[‘c’] = ‘Sofa’objects.clear()print(objects)
Complete the code below to produce ‘Student Name: ABC’ and ‘…
Complete the code below to produce ‘Student Name: ABC’ and ‘Student Age: 10’ as the output. XXXstudent1 = Student()student1.age = 10print(‘Student Name: {0}\n Student Age: {1}’.format(student1.name, student1.age) )
Which of the following is an example of a derived class?
Which of the following is an example of a derived class?
Given the following class definition, which of the following…
Given the following class definition, which of the following is the correct call for the method? class Games: def __init__(self): self.fav_game= ‘Tennis’ def print_game(self, diff_game): print(‘{0} is a better game than {1}.’.format(self.fav_game, diff_game))
In the code below, identify the correct instantiation of a n…
In the code below, identify the correct instantiation of a new class object. class Subtract: def __init__(self, num1, num2): self.num1= num1 self.num2 = num2 def calculate_diff(self): diff = self.num1 – self.num2 print(diff)
What is the Syntax to create a Frame ?
What is the Syntax to create a Frame ?