Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
What is docstring in Python?
Home
Technology
What is docstring in Python?
asked
Dec 7, 2020
in
Technology
by
JackTerrance
What is docstring in Python?
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Dec 7, 2020
by
JackTerrance
Documentation string or docstring is a multiline string used to document a specific code segment.
The docstring should describe what the function or method does.
Related questions
0
votes
Q: What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2)
What will be the output of the following Python code? >>>list1 = [1, 3] >>>list2 = list1 >>>list1[0] = 4 >>>print(list2) a) [1, 4] b) [1, 3, 4] c) [4, 3] d) [1, 3]...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='')
What will be the output of the following Python code? print('*', "abcde".center(6), '*', sep='') a) * abcde * b) *abcde * c) * abcde* d) * abcde *...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: To add a new element to a list we use which Python command?
To add a new element to a list we use which Python command? a) list1.addEnd(5) b) list1.addLast(5) c) list1.append(5) d) list1.add(5)...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the value of ‘result’ in following Python program?
What will be the value of ‘result’ in following Python program? list1 = [1,2,3,4] list2 = [2,4,5,6] list3 = [2,6,7,8] result ... ) [1, 7, 8] c) [1, 2, 4, 7, 8] d) error...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: Which of the following statements is used to create an empty set in Python?
Which of the following statements is used to create an empty set in Python? a) ( ) b) [ ] c) { } d) set()...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python code? print("abc. DEF".capitalize())
What will be the output of the following Python code? print("abc. DEF".capitalize()) a) Abc. def b) abc. def c) Abc. Def d) ABC. DEF...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What arithmetic operators cannot be used with strings in Python?
What arithmetic operators cannot be used with strings in Python? a) * b) – c) + d) All of the mentioned...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python program? z=set('abc') z.add('san') z.update(set(['p', 'q'])) z
What will be the output of the following Python program? z=set('abc') z.add('san') z.update(set(['p', 'q'] ... ;, ‘c’, [‘p’, ‘q’], ‘san}...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answres
0
votes
Q: Which module in the python standard library parses options received from the command line?
Which module in the python standard library parses options received from the command line? a) getarg b) getopt c) main d) os...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc', 'def'] print(id(q) == foo(q))
What will be the output of the following Python program? def foo(x): x[0] = ['def'] x[1] = ['abc'] return id(x) q = ['abc ... (id(q) == foo(q)) a) Error b) None c) False d) True...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id="224" >>>temp = tester(12) >>>print(temp.id)
What will be the output of the following Python code? class tester: def __init__(self, id): self.id = str(id) id="224" >>>temp ... >>>print(temp.id) a) 12 b) 224 c) None d) Error...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: Which one of the following is not a keyword in Python language?
Which one of the following is not a keyword in Python language? a) pass b) eval c) assert d) nonlocal...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: Which function is called when the following Python program is executed? f = foo() format(f)
Which function is called when the following Python program is executed? f = foo() format(f) a) str() b) format() c) __str__() d) __format__()...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: Which of the following statements is used to create an empty set in Python?
Which of the following statements is used to create an empty set in Python? a) ( ) b) [ ] c) { } d) set()...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
0
votes
Q: What will be the output of the following Python code? print("abc. DEF".capitalize())
What will be the output of the following Python code? print("abc. DEF".capitalize()) a) Abc. def b) abc. def c) Abc. Def d) ABC. DEF...
asked
Jan 2, 2023
in
Technology
by
JackTerrance
python-questions-answers
...