-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday2.py
330 lines (85 loc) · 2.54 KB
/
day2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
'''def cude(a,b):
return a*b
c=int(input())
d=int(input())
print(cude(c,d))
def cude (a):
return a**3
b=int(input())
print(cude(b))
for i in range(1,1000):
print(i)'''
'''a=open("kunjabijukchhe.txt","w")
for i in range(1,1001):
a.write(str(i))
a.write(". Kunja Bijukchhe\n")'''
'''a="kunja bijukchhe"
for i in a.split():
print(i)'''
'''# importing randint function
# from random module
from random import randint
# Function which generates a new
# random number everytime it executes
def generator():
return randint(1, 10)
# Function takes user input and returns
# true or false depending whether the
# user wins the lucky draw!
def rand_guess():
# calls generator() which returns a
# random integer between 1 and 10
random_number = generator()
# defining the number of
# guesses the user gets
guess_left = 3
# Setting a flag variable to check
# the win-condition for user
flag = 0
# looping the number of times
# the user gets chances
while guess_left > 0:
# Taking a input from the user
guess = int(input("Pick your number to "
"enter the lucky draw\n"))
# checking whether user's guess
# matches the generated win-condition
if guess == random_number:
# setting flag as 1 if user guessses
# correctly and then loop is broken
flag = 1
break
else:
# If user's choice doesn't match
# win-condition then it is printed
print("Wrong Guess!!")
# Decrementing number of
# guesses left by 1
guess_left -= 1
# If win-condition is satisfied then,
# the function rand_guess returns True
if flag is 1:
return True
# Else the function returns False
else:
return False
# Driver code
if __name__ == '__main__':
if rand_guess() is True:
print("Congrats!! You Win.")
else:
print("Sorry, You Lost!")'''
'''class circle:
pi = 3.14
def __init__(self,radius):
self.radius=radius
self.area=radius*radius*circle.pi
def circumfrence(self):
return self.radius*self.pi*2'''
cont = "Y"
while cont.upper()== "Y":
for i in range(2):
print(i)
cont = input("Continue?y/n:")
if cont == "n":
break