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
PLEASE HELP!! WILL MARK BRAINLIEST!!
Kobotan [32]

Answer:

Wow, that’s pretty good question.

I would probably get a vpn because it gives free secure WiFi. And it’s most reliable.

Hope I helped!

7 0
3 years ago
The dlci field in the frame relay header is _________ bits long.
ycow [4]
6 or 10-bit length

DLCI (Data Link Connection Identifier) is the essence of the Frame Relay Header. This value length represents the virtual connection between the DTE and the switch. The DLCI values are unique only to the physical channel on which they reside and thus, maintaining local significance only.



4 0
3 years ago
How can you employ one of the most powerful interactive business tools on the Internet today?
Dovator [93]

Answer:start a blog. I read the book.

Explanation:

7 0
3 years ago
Which statement is true?
Alexeev081 [22]

Answer:

Bjarne Stroustrop published the first reference guide for C++

Explanation:

Bjarne Stroustrop is a computer scientist who created the C++ programming language while working at the AT&T Bell laboratory. He also published the first reference guide for the programming language.

In October 1985, the book, The C++ Programming Language, was published. It describes the c++ programming language and was the only documentation and reference guide for the programming language at the time. Newer editions have since been published.

7 0
3 years ago
Read 2 more answers
Which keys should you press to insert a comment? Ctrl+Alt+I Ctrl+Alt+C Ctrl+Alt+O Ctrl+Alt+N Ctrl+Alt+M
MatroZZZ [7]

In OpenOffice Writer, you can insert comments with the Comment option under the Insert tab. Alternatively, you can use the Ctrl+Alt+N keys.

4 0
3 years ago
Other questions:
  • A ____ is text and graphics that print at the bottom of every page.
    12·1 answer
  • Uma organização pode ser entendida como uma instituição ou associação com objetivos predefinidos. Qual é um dos primeiros concei
    10·1 answer
  • With which type of media are you interacting when you read an online shopping website?
    7·1 answer
  • Complexities of communication are organized into successive layers of protocols: lower-level layers are more specific to medium,
    8·1 answer
  • Jabari is writing a program which prompts a user for a value with a decimal. Which function should he use? float() int() print()
    9·2 answers
  • How do you calculate typing speed
    8·1 answer
  • A large amount of scatter in a scatterplot is a indication that the association between the two variables is
    13·2 answers
  • What is out put in a computer
    14·2 answers
  • Accessing a computer system by using several words is known as​
    13·2 answers
  • In addition to reduced power consumption, what is an advantage of using hyperscale cloud computing data centers?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!