In Python you can use random module
Example :
import random
x = random.randint(0,10) # The Numbers in the bracket are the start and stop values
print(x)
or
import random
a = ["apple","banana","mango"]
x = random.choice(a)
print (x)
In C language you need to add header file stdlib.h and use inbuilt function rand()
Example:
rand() % (u – l + 1)) + l
Here,
u is the upper limit. l is the lower limit.
So, if we want to find a random number between 0 to 9, it will be :
(rand() % (9 - 0 + 1)) + 0
or
rand() % 10
Similarly, we can find out a random number in a given range using the same formula.
In C++
You can use the same function from C with same header file