1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Arada [10]
3 years ago
6

In the function below, use a function from the random module to return a random integer between the given lower_bound and upper_

bound, inclusive. Don't forget to import the random module (before the function declaration). For example return_random_int(3, 8) should random return a number from the set: 3, 4, 5, 6, 7, 8 The whole point of this question is to get you to read the random module documentation.

Computers and Technology
1 answer:
sladkih [1.3K]3 years ago
6 0

Answer:

import random

def ran(lower_bound, upper_bound):

   return random.randrange(lower_bound, upper_bound)

print(ran(3, 8))

Explanation:

The programming language used is python.

Modules are imported using the import keyword. In the first line the random module is imported.

A function ran is defined and it has two parameters, lower and upper bound that wll be passed to the function from random module.

The random module is a module that is used to generate random numbers, it is a very common module in programming, some of the popular functions in the module are random.randint and random.randrange. There are several other functions but these are the most common. the randint(a, b) takes two arguments and returns a random integer between the two arguments.

randrange(start, stop, step); It can take up to three arguments but has only compulsory argument that must be given for it not to generate an error and that is the stop.

when only the stop is defined, it assumes the start as zero and creates a range from 0 - stop and returns a random number within that range.

When start and stop arguments are given, it returns a number within the range of start - stop.

Start and stop must be given for there to be a step, if the step is given, it means the array containing the range of numbers will skip a step after each number.

The program makes use of the random.randrange(start, stop) and the upper and lower bounds are passed as its arguments.

Finally, the function is called and its return value is printed to the screen.

You might be interested in
3. Which swim_backwards method is called when sammy.swim_backwards() is executed? Why?
Georgia [21]
Classes called child classes or subclasses inherit methods and variables
4 0
2 years ago
Your unit has an upcoming training event. What form is used to record and maintain document numbers for ammunition documents?
aleksklad [387]

Ammunition documents which caries bullet, fuses extra should be numbered properly.

<u>Explanation:</u>

A document number or page number should be well organized and he or she coordinates with assistant trainers who have involved it.

Since it is a training event. The trainer has to have a checklist and make as fill with page number and make sure page numbers are strictly followed during the training session. If any page number is misplaced through the training session it will be embracing the situation for trainer and student or staff who get the training.

8 0
3 years ago
In ____, data can move in both directions at the same time, such as with a telephone.
gtnhenbr [62]

The answer is d. full-duplex transmission. This communication setup allows for simultaneous transmit and receive for both parties. As signals are able to be transmitted at the same time two way for both parties, for both directions along the same data carrier medium.

4 0
3 years ago
What’s the answer for this
attashe74 [19]
I believe the answer is B<span />
3 0
3 years ago
Which of the following translates packets so that the node can understand them once they enter through a port?
podryga [215]
Hi
D)A NICHappy to assist you!
8 0
3 years ago
Read 2 more answers
Other questions:
  • How useful do you find the creation of folders in your computer?
    8·2 answers
  • When reading a ____ language, we use our understanding of the richness of the language's vocabulary to extract the meaning. geop
    10·1 answer
  • Evaluate the following expression with precedence of operator:<br> ​ X = 2* 3/ 5 + 10 //3 – 1
    13·1 answer
  • You're setting up some VMs to test an application you're considering making available to employees of the small company you work
    11·1 answer
  • You have just finished installing a network adapter adapter and booted up the system, the drivers. You open File Explorer on a r
    13·1 answer
  • Which of the following is true of binary files?
    6·2 answers
  • What can happen if you do not follow the directions of medicine or the directions from the doctor? (Give 4 examples)​
    15·1 answer
  • In which situation would saving a Word document as a PDF be most useful?
    9·2 answers
  • Can someone please give me the 3.6 code practice answer I will mark you brainlyist
    13·1 answer
  • . Which responsibility belongs to the marketing function?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!