-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprag.py
More file actions
28 lines (26 loc) · 826 Bytes
/
Copy pathprag.py
File metadata and controls
28 lines (26 loc) · 826 Bytes
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
class target_Check:
def __init__(self):
self.flag = None
self.target_val = None
self.list = []
self.val = 0
self.size = None
def check(self):
self.flag = 0
print("Enter target value.")
self.target_val = int(input())
print("Enter number of input.")
self.size = int(input())
print("Enter sequence of numbers.")
for index in range(0, self.size):
self.val = int(input())
self.list.append(self.val)
for index in self.list:
for index1 in self.list:
if index-index1 == self.target_val:
self.flag = 1
break
if self.flag == 1:
print("Target achieved.")
else:
print("Target not achieved.")