-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
58 lines (45 loc) · 817 Bytes
/
Copy pathtest.py
File metadata and controls
58 lines (45 loc) · 817 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
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
# print("the {} side {1} {2}".format('bright','of','liofe'))
# x='abcdef'
# i="a"
# while i in x[:-1]:
# print(i, end=" ")
# l=[1,2,3,4,5]
# m=map(lambda x: 2**x,l)
# print(list(m))
# z=set("abc")
# z.add("san")
# z.update(set(['p','q']))
# print(z)
# import re
# result=re.findall("Welcome to Turing","Welcome",1)
# print(result)
# t='%(a)s %9b)s %(c)s'
# print(t%dict(a='Welcome',b='to',c='Turing'))
# def func1():
# x=50
# return x
#
# func1()
# print(x)
# data=[1,2,3]
# def incr(x):
# return x+1
#
# print(list(map(incr, data)))
# Y=[2,5J,6]
# Y.sort()
# print(Y)
# def f(x,l=[]):
# for i in range(x):
# l.append(i*i)
# return l
#
# print(f(2))
# print(f(3,[3,2,1]))
# print(f(3))
#
# l=[]
# l.insert()
a=[1,2,3,4]
b=[sum(a[0:x+1]) for x in range(0,len(a))]
print(b)