-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
116 lines (109 loc) · 2.47 KB
/
test.py
File metadata and controls
116 lines (109 loc) · 2.47 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import re
# print '.a'.capitalize()
print 'ab' in 'abnormal'
# print r'a' == r'\w'
# print '12314a'.count(r'\w')
# class Counter(object):
# def __init__(self):
# self.matched = 0
# def __call__(self, matchobj):
# self.matched += 1
#
# counter = Counter()
# x = re.sub(r'\d', counter, '12314a')
# print x
# print counter.matched
# print r'124' in '12314a'
# def jk(x):
# x = x + 1
#
# x = 1
# print x
# jk(x)
# print x
# def hi():
# return (1, 2, 3)
# x, y, z = hi()
# print x
# print y
# print z
# print 1 == 1.0
# f = open('text', 'rb')
# found = False
# while True:
# a = f.read(1)
# if a == 'a':
# found = True
# elif found:
# found = False
# if found and a == 's':
# print 'YAYAYAYAY\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n'
# break
# r = range(10)
# print r
# def lazy():
# print 'hi'
# return 1
# r = lazy()
# print 'a'
# print r
# print re.sub('[^a-zA-z-\' ]|\[|\]', '', '[Falls on the bed, and dies]')
# print re.sub(r'speaker (.*)', r'|speaker|\1|lines|', 'asdsdaspeaker sfjskn')
# def addDicts(original, addition): #, remove):
# if 'subsets' in addition:
# addition.pop('subsets', None)
# for key in addition:
# if key in original:
# if isinstance(original[key], dict) and isinstance(addition[key], dict):
# original[key] = addDicts(original[key], addition[key])
# # elif isinstance(original[key], int) and isinstance(addition[key], int): #or array
# else:
# original[key] += addition[key]
# else:
# original[key] = addition[key]
# return original
#
# addDicts({'ad': 23, 'subsets': [1,2,3], 'hi': 213})
# a = "[[1,2,3,4,5,6,7], [1,2,3]]"
# # fib = re.sub(r'\], \[', '|', a)
# # fib = re.sub(r'\]|\[', '', fib)
# fib = re.sub(r'\], \[', '|', a)
# re.sub(r'\], \[', '@', a)
# fib = re.sub(r'\]|\[', '', fib)
# fib = fib.split('|')
# # for num in range(len(a)):
# # a[num] = 0
# print fib
# print a
#
# a = [0,1,2,3,4,5]
# print a[2:4]
#
#
# words = ['AS-dc SFBKK', 'a', 'saj']
# word = 'b'
# # print words.lower()
# if not word in words:
# print 'hi'
#
# for char in 'abcdefg':
# print char
#
# c = {
# 'high': 34,
# 'donuts': 23
# }
#
# print isinstance({'hi': 0, 'a': 1}, dict)
#
# for i in range(4):
# a += [[]]
# print len(a)
#
#
# print '\n\n\n'
# if 'hi' in {'12': 23, 'hisa': 'hi'}:
# print 'hi'
# in == in .keys()
# print 'hilo' if True
# x = {'hs': 23, if True: 'a': 12}