-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoutput.py
79 lines (53 loc) · 973 Bytes
/
output.py
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
def eof(fp):
ans=fp.read(1)
fp.seek(fp.tell()-1)
return not ans
def sayhi(name) :
print("hello"+name)
def outputzero(x,y) :
return 0# Comment 1
# Comment 2
x=3
print(x)
for i in range(1, 10):
print(i)
while x!=5:
print(x)
x+=1
while True:
answer=input("What's the password?")
if answer=="computer":
break
if x==5 or x==3**2:
print(x)
elif x==7:
print(x+6)
else:
print("hello, world")
if x == 1:
print("it\'s 1")
if x == 5:
print("it\'s 5")
y="hello"
print(len(y))
print(y[1:3])
sayhi("chinmaya")
names = [0] * 5
names[0]="Ahmad"
names[1]="Ben"
names[2]="Catherine"
names[3]="Dana"
names[4]="Elijah"
print(names[3])
board = [[0 for x in range(8)] for y in range(8)]
board[outputzero(5,4)][0]="rook"
myFile=open("sample.txt")
x=myFile.readline()
myFile.close()
myFile=open("sample.txt")
while not eof(myFile):
print(myFile.readline())
myFile.close()
myFile=open("sample.txt", "w")
myFile.write("Hello World")
myFile.close()