- What is Module, Package, and Library in Python?
- How the following import statements are different, explain with programming examples:
- import X
- from X import *
- from X import a,b
- Consider the following code :
What could be the possible outputs out of the given choices, also state the reason for each option, why :
1 2 3 4 5
import math import random print(str(int(math.pow(random.randint(2,4),2))), end =" ") #Statement1 print(str(int(math.pow(random.randint(2,4),2))), end =" ") #Statement2 print(str(int(math.pow(random.randint(2,4),2)))) #Statement3
- 2 3 4
- 9 4 4
- 16 16 16
- 2 4 9
- 4 9 4
- 4 4 4
- Create a module length conversion.py that stores function for various length conversions e.g.
- miletokm( ) to convert miles to kilometers
- kmtomile( ) to convert kilometers to miles
- feettoinches( ) to convert feet to inches
- inchestofeet( ) to convert inches to feet
No comments:
Post a Comment