Hi I have been studying python for a few weeks and have made a few small projects, one of them being a lottery number generator. I was wondering what typical nooby mistakes I have made, also what I could do to clean up my code to make it look nicer. Would also help if someone would give me a suggestion on what else I could add onto it (don't tell me how to do it just give me suggestion please)
import random
nums = list(range(1,51))
nums2 = list(range(1,12))
random.shuffle(nums)
random.shuffle(nums2)
range_of_numbers = nums[:5]
range_of_numbers2 = nums2[:2]
range_of_numbers2.sort()
range_of_numbers.sort()
print("Your Lottery Numbers Are: " + str(range_of_numbers) + ("\nYour Jackpot Numbers Are: ") + str(range_of_numbers2))
question1 = input("Are you happy with your Numbers?")
print("Good Luck! ") if question1 == ("Yes") or ("yes") else print ("Sorry try again")
while question1 == ("No"):
print("Your Lottery Numbers Are: " + str(range_of_numbers) + ("\nYour Jackpot Numbers Are: ") + str(range_of_numbers2))
question1 = input("Are you happy with your Numbers?: ")
Also if anyone has any courses i can take to better my skills id be more than happy to hear it , im currently doing the cs50p course.
Thanks.
import random
nums = list(range(1,51))
nums2 = list(range(1,12))
random.shuffle(nums)
random.shuffle(nums2)
range_of_numbers = nums[:5]
range_of_numbers2 = nums2[:2]
range_of_numbers2.sort()
range_of_numbers.sort()
print("Your Lottery Numbers Are: " + str(range_of_numbers) + ("\nYour Jackpot Numbers Are: ") + str(range_of_numbers2))
question1 = input("Are you happy with your Numbers?")
print("Good Luck! ") if question1 == ("Yes") or ("yes") else print ("Sorry try again")
while question1 == ("No"):
print("Your Lottery Numbers Are: " + str(range_of_numbers) + ("\nYour Jackpot Numbers Are: ") + str(range_of_numbers2))
question1 = input("Are you happy with your Numbers?: ")
Also if anyone has any courses i can take to better my skills id be more than happy to hear it , im currently doing the cs50p course.
Thanks.