-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain6.py
More file actions
64 lines (51 loc) · 1.68 KB
/
Copy pathmain6.py
File metadata and controls
64 lines (51 loc) · 1.68 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
list_methods = []
for method in dir(list):
if method.startswith("__"):
continue
list_methods.append(method)
set_methods = []
for method in dir(set):
if method.startswith("__"):
continue
set_methods.append(method)
string_methods = []
for method in dir(str): #string methodunun sınıfı str dir.
if method.startswith("__"):
continue
string_methods.append(method)
tuple_methods = []
for method in dir(tuple):
if method.startswith("__"):
continue
tuple_methods.append(method)
dict_methods = []
for method in dir(dict):
if method.startswith("__"):
continue
dict_methods.append(method)
basliklar = ["list_methods", "set_methods", "string_methods", "tuple_methods", "dict_methods"]
classes = [list_methods, set_methods, string_methods, tuple_methods, dict_methods]
max_len = 0
for class_ in classes:
if len(class_) > max_len:
max_len = len(class_)
with open("Methods.txt", "w") as f:
for baslik in basliklar:
print(baslik,end="")
print(" " * (30 - len(baslik)),end="")
f.write(baslik)
f.write(" " * (30 - len(baslik)))
for i in range(max_len):
print()
f.write("\n")
for class_ in classes:
if i >= len(class_):
print("-------", end="")
print(" " * 23, end="")
f.write("-------")
f.write(" " * 23)
else:
print(class_[i], end="")
print(" " * (30 - len(class_[i])), end="")
f.write(class_[i])
f.write(" " * (30 - len(class_[i])))