Jun-03-2019, 09:16 PM
Am trying to generate 2 random lists using below code
import random a = random.randint(range(1,10)) b = random.randint(range(1,15)) c = [i for i in b if i in a] print(c)And while running giving below error. What i did wrong ?
Output:C:\Users\ASUS\PycharmProjects\Pratice\venv\Scripts\python.exe C:/Users/ASUS/.PyCharmCE2019.1/config/scratches/Pratice.py
Traceback (most recent call last):
File "C:/Users/ASUS/.PyCharmCE2019.1/config/scratches/Pratice.py", line 2, in <module>
a = random.randint(range(1,10))
TypeError: randint() missing 1 required positional argument: 'b'
Process finished with exit code 1