-
Notifications
You must be signed in to change notification settings - Fork 181
/
Copy pathtestofdivisibility.py
44 lines (40 loc) · 1.3 KB
/
testofdivisibility.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
# pre code
def testDivisibility():
print(" ")
toTest = int(raw_input("Enter number of which you want to test Divisibility : "))
print(" ")
test = int(raw_input("Enter number by which you want to test : "))
if toTest % test == 0 :
print("-------------Answer---------------- ")
print(str(toTest) + " is divisible by " + str(test))
else :
print(str(toTest) + " is not divisible " + str(test))
print(" ")
print("--------------------Start-------------------")
user = raw_input("Start or End : ")
if user.strip() == "Start" :
print(testDivisibility())
print(" ")
# MAIN code
while True:
get = raw_input("Start again or End : ")
if get.strip() == "Start again":
print("---------------Start Again----------------")
print(" ")
continue
elif get.strip() == "End" :
print(" ")
print("------------------Program Ended--------------")
print(" ")
break
else :
break
elif user.strip() == "End" :
print(" ")
print("------------Program Ended-----------")
print(" ")
break
else :
print(" ")
print("Invalid Input. Try again")
continue