15 solutions available
Question 2What are docstrings ? What is their significance ? Give example to support your answer.
Question 9In which order Python looks for the function/module names used by you.
Question 12What is dot notation of referring to objects inside a module ?
Question 13Why should the from <module> import <object> statement be avoided to import objects ?
Question 14What do you understand by standard library of Python ?
Question 15Explain the difference between import <module> and from <module> import statements, with examples.
Question 3Given below is semi-complete code of a module basic.py :# """...............""" def square(x): """...............""" return mul(x, x)...
Question 5Import the above module basic.py and write statements for the following :(a) Compute square of 19.23.(b) Compute floor division of 1000.01...
Question 6Suppose that after we import the random module, we define the following function called diff in a Python session :def diff(): x =...
Question 7What are the possible outcome(s) executed from the following code? Also specify the maximum and minimum values that can be assigned to...
Question 8Consider the following code :import random print(int(20 + random.random() * 5), end = ' ') print(int(20 + random.random() * 5), end = ' ')...
Question 10Consider the following packagemusic/ Top-level package ├── __init__.py ├── formats/ Subpackage...
Question 11What are the possible outcome(s) executed from the following code ? Also specify the maximum and minimum values that can be assigned to...
Question 1Write a Python program having following functions :A function with the following signature : remove_letter(sentence, letter)This function...
Question 4Create a package from above two modules as this :Conversion ├──Length │ └──Lengthconversion.py └──Mass...