-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfun_functions.py
More file actions
38 lines (29 loc) · 766 Bytes
/
Copy pathfun_functions.py
File metadata and controls
38 lines (29 loc) · 766 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
def odd_even():
for num in range (0,2001):
if (num%2==1):
print "Number is",num,". This is an odd number."
else:
print "Number is",num,". This is an even number."
odd_even()
def multiply(arr, num): #name parameters and internal variables differnt names
new_list = []
# print new_list
for val in arr:
# print num
new_list.append(val * num)
print new_list
# print arr
return new_list
a = [2,4,10,16]
b = multiply(a, 5)
print b
def challengee(arr):
new_array=[]
for val in arr:
temp = []
for x in range(val):
temp.append(1)
new_array.append(temp)
return new_array
x = challengee(multiply([2,4,5],3))
print x