-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRangeFunction.py
More file actions
57 lines (42 loc) · 1.12 KB
/
RangeFunction.py
File metadata and controls
57 lines (42 loc) · 1.12 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
def wscube(*args):
p = len(args)
r = []
if p == 1:
i = 0
if args[0] > 0:
while i<args[0]:
r.append(i)
i += 1
elif args[0]<0:
while i>args[0]:
r.append(i)
i = i - 1
elif p == 2:
i = args[0]
if args[1] > 0:
while i<args[1]:
r.append(i)
i += 1
elif args[1]<0:
while i>args[1]:
r.append(i)
i = i - 1
elif p ==3:
i = args[0]
if args[2] > 0:
while i<args[1]:
r.append(i)
i = i + args[2]
elif args[2]<0:
while i>args[1]:
r.append(i)
i = i + args[2]
elif args[2]==0:
print("Wrong input")
else:
print("Wrong input")
else:
print("Wrong input")
return tuple(r)
for p in wscube(1,15,2):
print(p)