Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q4:- Which of the following is correct ? deafaultdict throws a KeyErrror when the key is not present in it. Sorting dictionary by the key

Q4:-

Which of the following is correct ?

  1. deafaultdict throws a KeyErrror when the key is not present in it.
  2. Sorting dictionary by the key has more runtime accessing than the sorting by the value.

c)Sorting dictionary by the key has less runtime accessing than the sorting by the value.

d).None of these.

Q5:-

Choose the correct statement:-

  1. getattr() and setattr() are used to retrieve and set class attributes.
  2. pow() and ** will always produce the same value.
  3. getattr() and setattr() are used to retrieve and set Constructor attribute.
  4. None of these.

Q7:-

Choose the correct statement:-

  1. Prints the database_information

connection = getDbConnection()

test1 =connection.get_server_info()

cursor = connection.cursor()

cursor.execute("select database();")

test2 = cursor.fetchone()

print(test2)

closeDbConnection(connection)

  1. Prints the records for the selected database

connection = getDbConnection()

test1 = connection.get_server_info()

cursor = connection.cursor()

cursor.execute("select database();")

test2 = cursor.fetchone()

print(test1)

closeDbConnection(connection)

  1. Both
  2. None of these

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems A Practical Approach To Design Implementation And Management

Authors: THOMAS CONNOLLY

6th Edition

9353438918, 978-9353438913

More Books

Students also viewed these Databases questions