-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.py
96 lines (39 loc) · 1009 Bytes
/
file.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
80
81
82
83
84
85
86
87
88
89
90
#exp1
'''f = open ("files.txt","r")
content = f.read()
print(content)
f.close()'''
#exp2
'''with open("files.txt","r") as f:
content = f.readlines()
print (content)
for line in content:
print(line,end=" ")'''
#exp3
'''with open ("files.txt","r") as f:
for line in f:
print(line,end=" ")'''
#exp4
'''with open("files.txt","r") as f:
line = f.readline()
print(line,end="")'''
#exp5
'''with open("files.txt","r") as f:
line = f.read(1000)
print(line)'''
#exp6
'''with open("file2.txt","w") as f:
f.write("I am gulcihan I want to be a coder\n")
f.write("hello")'''
#exp7
'''import random
#with open("number_history.txt","w") as number_files
number_files = open("number_history.txt","w")
while True:
number = random.randrange(1000)
print(number)
number_files.write(str(number))
#number_files.close()
if number == 77:
print("number founded")
break'''