-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode1.py
More file actions
63 lines (56 loc) · 1.49 KB
/
Code1.py
File metadata and controls
63 lines (56 loc) · 1.49 KB
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
ma=0
#My firrst comment to check the changes made by Github
def sanitize(time_string):
global ma
ma+=1
print(ma)
if '-' in time_string:
splitter = '-'
elif ':' in time_string:
splitter = ':'
else:
return(time_string)
(mins, secs) = time_string.split(splitter)
return(mins + '.' + secs)
with open('james.txt') as jaf:
data = jaf.readline()
james = data.strip().split(',')
##with open('julie.txt') as juf:
## data = juf.readline()
##julie = data.strip().split(',')
##
##with open('mikey.txt') as mif:
## data = mif.readline()
##mikey = data.strip().split(',')
##
##with open('sarah.txt') as saf:
## data = saf.readline()
##sarah = data.strip().split(',')
james = sorted([sanitize(t) for t in (james)])
##julie = sorted([sanitize(t) for t in julie])
##mikey = sorted([sanitize(t) for t in mikey])
##sarah = sorted([sanitize(t) for t in sarah])
unique_james = []
for each_t in james:
if each_t not in unique_james:
unique_james.append(each_t)
print(unique_james[0:3])
##print(james)
##print(james[0:3])
##unique_julie = []
##for each_t in julie:
## if each_t not in unique_julie:
## unique_julie.append(each_t)
##print(unique_julie[0:3])
##
##unique_mikey = []
##for each_t in mikey:
## if each_t not in unique_mikey:
## unique_mikey.append(each_t)
##print(unique_mikey[0:3])
##
##unique_sarah = []
##for each_t in sarah:
## if each_t not in unique_sarah:
## unique_sarah.append(each_t)
##print(unique_sarah[0:3])