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
Does anyone know how to by pass this pls help?
Triss [41]

Answer:

Yeah all you Gotta do is press download file

Explanation:

mark me brainliest!!

3 0
2 years ago
If you want to add text in an area of a slide where a content placeholder is not located, you can insert a(n) _______________.
bulgar [2K]
You can insert a text box ~ wubba lubba dub dub!
6 0
3 years ago
Why is it preferable to code web pages in html format?
Ronch [10]
Depends on what you are working on.

If you are working on a website I recommend Adobe Dreamweaver CC.

if its small assignments that doesnt involve major work, I'd use something like notepad++
8 0
4 years ago
Read 2 more answers
Order the steps to use a logical argument as a rule type.
muminat

Answer:

Click home tab, click conditional formatting, click new rule, use formula to determine

6 0
3 years ago
Read 2 more answers
A pointing device used mainly for computer games is known as
kolbaska11 [484]

Answer: Joystick is the only one that makes sense, a stylus and digitizer are both used on drawing tablets, not computer games.

5 0
2 years ago
Other questions:
  • A data structure used to bind an authenticated individual to a public key is the definition of ________.
    14·1 answer
  • Which tab is used to edit objects on the slide master and layouts
    10·1 answer
  • Which process refers to starting up a computer?
    13·2 answers
  • For each of the following polynomials, apply either the Muller's method or the Bairstow's method to find all real or complex roo
    15·1 answer
  • How many total bits are required for a direct-mapped cache with 128 blocks and a block size of 8 bytes, assuming a 4GB main memo
    15·1 answer
  • Which are the following 4 things something must be able to do in order to be a computer? *
    9·1 answer
  • The function retrieveAt of the class arrayListType is written as a void function. Rewrite this function so that it is written as
    10·1 answer
  • After running the following pseudocode, what will the value of VARIABLE be? 1. Set value of VARIABLE to 5 2. Increase the value
    15·1 answer
  • What is the best definition of inflation?
    14·1 answer
  • What is the most important person and why
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!