-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasics.py
More file actions
39 lines (32 loc) · 753 Bytes
/
Copy pathbasics.py
File metadata and controls
39 lines (32 loc) · 753 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
import sys
import time
import cmd
def demo():
with open('words.txt') as f:
all_words = f.read().split('\n')
if(len(sys.argv) < 2):
num_to_print = int(input("please input a number: "))
else:
num_to_print = int(sys.argv[1])
if(num_to_print > 25):
print("Yo thats too big, pick something smaller")
else:
for x in range(num_to_print):
print(all_words[x])
for y in range(num_to_print-1, -1, -1): #inclusive, noninclusive, increment
print(all_words[y])
lst = all_words[:num_to_print]
for x in range(len(lst)):
print("------- " + lst[x])
def to_test(x):
if(x < 10):
return x*2
if(x % 2 == 0):
return x*3
else:
return 7
def building_on_to_test(x):
if(to_test(x) < 30):
return 3
else:
return 4