What does the function random.randrange(49,150) return in Python?
It returns a random number from 49 to 150
It returns a random number from 49 to 149
It returns a random number from 50 to 150
It returns a random number from 50 to 149
Answers
Answered by
0
It returns a random number from 49 to 149.
#returns a number between 49 (included) and 150 (not included; excluded)
- randrange is an python's inbuilt function in the class random. It returns a random value from the given range.
- To access this function, first, we need to import random class.
- randrange function takes three parameters start value, stop value, point range (Optional; by default : 1), in the same order.
import random
random.randrange(startvalue, stopvalue, rangingvalue(optional))
- Most of the programmers think that randrange() can return the extreme value too. NO! stopvalue is excluded from the random selection.
Learn more :
1) Write a python program to generate random no.
https://brainly.in/question/15069095
2) How to generate random numbers in Python ?
https://brainly.in/question/16087795
Attachments:
Similar questions