-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.py
More file actions
80 lines (65 loc) · 1.3 KB
/
error.py
File metadata and controls
80 lines (65 loc) · 1.3 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# a = 2
# b = 'Hassan'
# c = 0
# try:
# print(a+b)
# print(a/b)
# except TypeError as d:
# print(d)
# except ZeroDivisionError as e:
# print(e)
# else:
# print('no exception error')
# finally:
# print('this will always run')
# print("Hassan")
# try :
# exec('x === 4')
# except SyntaxError as r:
# print(r)
# r = open('file.text' , 'r')
# content = r.read
# r.close
# print(content)
# w = open('file.text' , 'w')
# w.write('new data')
# w.close
# r = open('file.text' , 'r')
# content = r.read
# r.close
# print(content)
# w = open('file5.text' , 'w')
# w.write('new file created')
# w.close
# a = open('file.text' , 'a')
# a.write('\n this is second data')
# a.close()
# r = open('file2.text' , 'r')
# r.write('this written using r+')
# r.seek(2)
# content = r.read()
# print(content)
# r.close()
# with open ('file2.text' , 'w+') as d:
# d.write('\nHassan')
# d.seek(0)
# content = d.read()
# print(content)
# x = 4
# y = 'Hassan'
# z = 0
# try:
# # print(x+y)
# print(x/z)
# except ZeroDivisionError as g:
# print(g)
# except TypeError as b:
# print(b)
# else:
# ('error')
# finally:
# print('this will everytime print.')
# try:
# exec('e === 5')
# except SyntaxError as w :
# print(w)