-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSum_repetition_checker.py
More file actions
28 lines (27 loc) · 882 Bytes
/
Sum_repetition_checker.py
File metadata and controls
28 lines (27 loc) · 882 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
#-------------------------------------------------------------------------------
# Name: Number repetition counter
# Purpose: Checks to see how many times, and where a number repeats in a list
#
# Author: tembov
#
# Created: 01/02/2015
# Copyright: (c) tembov 2015
# Licence: <your licence>
#-------------------------------------------------------------------------------
check = []
set = [1,8,11,24,33,39,41,56,71,78]
length = len(set)
ite = 0
while ite < length:
for i in range(length):
if ite != i:
print str(set[ite]) + " + " + str(set[i]) + " = " + str((set[ite] + set[i]))
check.append(set[ite] + set[i])
else:
pass
ite +=1
l_length = len(check)
print check
print ("We start here")
for i in range(l_length):
print str(check[i]) + " occurs " + str (check.count(check[i])/2) + " times."