-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncs.py
More file actions
45 lines (27 loc) · 705 Bytes
/
funcs.py
File metadata and controls
45 lines (27 loc) · 705 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
#-------------playing with functions
def inc(x):
x=x+1
x=10
inc(x)
#print(x)
def f1(list1):
list1.append("!!!")
l=['a','b']
#__________________Question 2_____________________________________
def lastToFirst(theList):
#get last value
last = theList.pop()
#put it infront
theList.insert(0,last)
#adding to the end is appending
hey = ['a','b','c','d','e']
lastToFirst(hey)
print(hey)
me = [1,3]
#__________________Question 3_____________________________________
def getValue(theList,indiceList):
newList = []
for a in indiceList:
newList.append(theList[a])
return newList
print(getValue(hey,me))