import random
x = input(" minim radom range:")
z = input("maxrange")
print(random.randrange(x, z))
Asked
Active
Viewed 35 times
-1

Muhammad Mohsin Khan
- 1,444
- 7
- 16
- 23

rafax
- 1
-
2use code blocks to post code – seric sheon Mar 19 '22 at 08:34
2 Answers
0
you need to use int() while getting input as following:
import random
x = int(input(" minim radom range:"))
z = int(input("maxrange"))
print(random.randrange(x,z))

Baris Ozensel
- 433
- 1
- 3
- 11
0
this happens because "input" gets the value from user as string so you need to convert it to int
x = int(input(" minim random range:"))
z = int(input("max range"))

seric sheon
- 85
- 6