Mar-10-2024, 09:59 PM
(This post was last modified: Mar-10-2024, 09:59 PM by deanhystad.)
Your code never calls luckfactorfunction(). Check indenting, I think you have an error with that.
I'm pretty sure this does not do what you think it does:
Do not use randome.sample to get a random int in some range. Instead of this:
I'm pretty sure this does not do what you think it does:
randomnumber != range(1, 776) and range(778, 1000)A number will never equal an iterator, so randomnumber != range(1, 776) is always true.
Do not use randome.sample to get a random int in some range. Instead of this:
randomnumber = random.sample(range(1, 1000), 1)do this:
randomnumber = random.randint(1, 999)Can you describe what this code is supposed to do?
def luckfactorfunction(): if randomnumber != 777: print("jackpot") else: if randomnumber != range(1, 776) and range(778, 1000): print("better luck next time") luckfactorfunction()