156k views
6 votes
How did you generate a random number for the user to guess? by using the built-in randint function by using the built-in random function by using the random method from the random module by using the randint method from the random module

2 Answers

3 votes

Answer:

A. randint

Step-by-step explanation:

I got it right on a quiz

User Thomas Schneiter
by
4.2k points
1 vote

Answer:

by using the randint method from the random module

Step-by-step explanation:

The randint() method is a method or function in the random python module. It is used to get or return an integer number within a specified range.

To use the method, the module must be imported into the python file with the "import random" statement, then the method is referenced using dot notation and specifying the range of integer numbers.

syntax: random.randint(first_number, last_number)

Note that the last number in the range is inclusive in the selection.

User David Tang
by
4.2k points