A student is learning Python using the interactive interpreter mode. The student issues these commands: Which command should the student use to create an object with one attribute being a valid URL?

IT Questions BankCategory: DevNetA student is learning Python using the interactive interpreter mode. The student issues these commands: Which command should the student use to create an object with one attribute being a valid URL?
A student is learning Python using the interactive interpreter mode. The student issues these commands: Which command should the student use to create an object with one attribute being a valid URL? 1ITExamAnswers Staff asked 4 weeks ago
Question:
A student is learning Python using the interactive interpreter mode. The student issues these commands:

>>> class Uri():
... def_init__(self, host, prot):
... self.host = host
... self.prot = prot
... self.url = self.prot + "://" + self.host
>>>

Which command should the student use to create an object with one attribute being a valid URL?

  • >>> url2 = Url(URL, ‘http://’, ‘www.cisco.com’)
  • >>> url2 = Url(‘http’, ‘://’, ‘www.cisco.com’)
  • >>> url2 = Url(‘www.cisco.com’,’http’)
  • >>> url2 = Url(‘http’, ‘www.cisco.com’)

More Questions: DevNet Associate (v1.0) – Module 3 Exam Answers


Related Articles