-
Notifications
You must be signed in to change notification settings - Fork 181
/
squarecube.py
50 lines (47 loc) · 1.31 KB
/
squarecube.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
# pre code
def square():
print(" ")
makeUse = raw_input("Square or Cube : ")
if makeUse.strip() == "Square":
print(" ")
user = int(raw_input("Enter number to get square : "))
square = user ** 2
print(" ")
print("Square of the number " + str(user) + " is " + str(square))
elif makeUse.strip() == "Cube":
print(" ")
userAgain = int(raw_input("Enter number to get square : "))
cube = userAgain ** 3
print(" ")
print("Cube of the number " + str(userAgain) + " is " + str(cube))
# main code
while True:
print("Hello,")
print(" ")
startOrEnd = raw_input("Start or End : ")
print(" ")
if startOrEnd.strip() == "Start":
print(square())
elif startOrEnd.strip() == "End":
print(" ")
print(" ")
print("Program Ended......")
break
else :
print(" ")
print("Try Again")
continue
startagain = ("Start again or End : ")
print(" ")
if startagain.strip() == "Start again":
print(" ")
print("Starting again.....")
continue
elif startagain == "End":
print(" ")
print(" ")
break
else :
print(" ")
print("Try Again")
continue