updating myrandom.py versions

This commit is contained in:
muassif
2021-08-12 13:44:25 +04:00
committed by GitHub
parent a758563415
commit 7416895085
2 changed files with 20 additions and 5 deletions
+1 -5
View File
@@ -1,4 +1,4 @@
# myrandom.py with default and custom random functions
# myrandomv2.py with default and custom random functions
import random
#random = __import__('random')
@@ -13,7 +13,3 @@ def random_1d():
def random_2d():
"""This function get a random number between 10 and 99"""
return random.randint(10,99)
def get_random(lower, upper):
"""This function get a random number between lower and upper"""
return random.randint(lower,upper)
+19
View File
@@ -0,0 +1,19 @@
# myrandomv2.py with default and custom random functions
import random
#random = __import__('random')
#random = importlib.import_module('random')
print (globals())
def random_1d():
"""This function get a random number between 0 and 9"""
return random.randint(0,9)
def random_2d():
"""This function get a random number between 10 and 99"""
return random.randint(10,99)
def get_random(lower, upper):
"""This function get a random number between lower and upper"""
return random.randint(lower,upper)