@@ -0,0 +1,1160 @@
+from random import randint%0Afrom math import pow%0A%0A# Ask for luck index(How lucky you feel today)%0Aprint %22Please set you luck index, (1 or 2 or 3 or 4),%22%0An = raw_input()%0A%0A# Set the according to luck index given by user%0An = int(pow(10, int(n)))%0A%0A%0A# If the user enter 0%0Aif(n==1):%0A%09n=2%0A%0A# Show chances of the winning%0A# Calculated as 1 - (chances of loosing)%0Aprint %22You will %25f probabilty to win. So, let try your luck.%22 %25 (1- pow((float(n-1)/n), 4))%0A%0A# 'choice' decides Till when the following loop will run(depends on users choice to play again)%0Aa = True%0Awhile a:%0A%09# initialize the list%0A%09l = %5B%5D%0A%09for x in range(0, 4):%0A%09%09# Generate four random numbers based on user input%0A%09%09l.append(randint(0, n-1))%0A%0A%09# Ask for an input%0A%09print %22Input a integer(0 to %25d): %22 %25 (n-1)%0A%09a = raw_input()%0A%09a = int(a)%0A%0A%09# Show if the user won or not%0A%09if a in l:%0A%09%09print %22You win!! :-)%22%09%0A%09else:%0A%09%09print %22You lose :-(%22%0A%09# Show user the list for transparency%0A%09print l%0A%0A%09# Ask for playing again...%0A%09print %22Wanna try again??, y to try your luck again: %22%0A%09a = raw_input()%0A%09if(a==%22y%22):%0A%09%09a =  True%0A%09else:%0A%09%09a = False%0A%09pass%0A%0A# Print greetings for playing%0Aprint %22Thank you for playing this game :)%22%0A

Create LuckyMe.py