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
Special keys that allow you to use the computer to perform specific functions
Pavel [41]

Answer:

Examples are Ctrl, Alt, Fn, Alt Gr, Shift, Caps Lock, Tab, Scroll Lock, Num lock, Esc, Windows Key, Backspace, Enter...

8 0
3 years ago
You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
n200080 [17]
The answer is b. java Hi.class :)
8 0
2 years ago
What is the best image format for our website if we needed our image to have a transparent background?
Rainbow [258]
PNG- Usually if you look up your picture and then add png to the end, it has a transparent background. Make sure it has free usage, though.
5 0
3 years ago
Select all of the true statements about financial literacy. Financial literacy is the knowledge about money and what you do with
erastova [34]

The correct statements about financial literacy from the given options are as follows:

  • Financial literacy is the knowledge about money and what you do with money.
  • Financial literacy includes information about income, banking, loans, career, credit, and consumer rights.
  • One reason to become financially literate is to save you money.
  • One reason to become financially literate is to help you make smart financial decisions.

The only option that isn’t included is: <em>One reason to become financially literate is to make you rich</em>.  Though knowledge about financial literacy can help you in managing your finances, you would need great amount of knowledge about other fields to be able to become rich - not just financial literacy.


5 0
2 years ago
Damage to which portion of the limbic system results in loss of memory of recent events and difficulty committing anything new t
Vera_Pavlovna [14]

Answer:

Hippocampus.

Explanation:

There are two parts of the limbic system. They are the frontal part which is the amygdala and the posterior part which is the hippocampus.

The hippocampus is an extension of the temporal part  of the cerebral cortex which is a plastic-like structure that can be easily damaged by stimuli. It is packed with densed neurons and forms an S-shape at the extension of the temporal part.

It is responsible for learning and memory and damage to it can result to memory loss of recently learnt information.

8 0
2 years ago
Other questions:
  • Clicking on the Spelling &amp; Grammar button is one way to correct a spelling error in Word. Please select the best answer from
    7·2 answers
  • When planning your educational and career path, it makes sense to consider where you want to work and what type of work you want
    14·1 answer
  • Write the percentage 5 1/4 as a decimal​
    8·1 answer
  • How many positions there are in the media and design department?
    14·2 answers
  • If you are running a server , which of the follow operating system would be best suited ?window 10 or macOS
    8·1 answer
  • what is example of application of machine learning that can be imposed in eduction. (except brainly.)
    9·1 answer
  • What is 30 x 30 x 30 x 30
    14·2 answers
  • The sequence of instructions performed to execute one program instruction
    12·1 answer
  • Immigrants are allowed to enter the country to work when they have a(n)
    10·1 answer
  • A related database stores data in the form of______
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!