I want to generate 6 numbers from 1 to 49 while fulfilling the following conditions:
- One of the 6 numbers always has to be a number that the user inputs.
- No duplicates
I created this code.
x2 = input()
print("")
print("Great! You will be able to get your lucky
numbers soon. Anwer Let's go! when you are ready.")
Q2 = input()
if Q2 == "Let's go!":
print("")
import random
randomlist = random.sample(range(1, 49), 5)
randomlist.insert(0, x2)
print(randomlist)
print("")
However, this code creates duplicates. What should I do?