Question
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 ?
- deafaultdict throws a KeyErrror when the key is not present in it.
- 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:-
- getattr() and setattr() are used to retrieve and set class attributes.
- pow() and ** will always produce the same value.
- getattr() and setattr() are used to retrieve and set Constructor attribute.
- None of these.
Q7:-
Choose the correct statement:-
- 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)
- 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)
- Both
- None of these
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started