-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwrite.py
More file actions
159 lines (140 loc) · 5.57 KB
/
write.py
File metadata and controls
159 lines (140 loc) · 5.57 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
# 1.
# To write a python program that takes in command line
# arguments as input and print the number of arguments.
# C 218.1
# 2. To write a python program to perform Matrix Multiplication. C 218.1
# 3.
# To write a python program to compute the GCD of two
# numbers. C 218.1
# 4.
# To write a python program to find the most frequent words in a
# text file.
# C 218.1
# 5.
# To write a python program find the square root of a number
# (Newton’s method).
# C 218.1
# 6. To write a python program exponentiation (power of a number). C 218.1
# 7.
# To write a python program find the maximum of a list of
# numbers.
# C 218.1
# 8. To write a python program linear search. C 218.2
# 9. To write a python program Binary search. C 218.2
# 10. To write a python program selection sort. C 218.2
# 11. To write a python program Insertion sort. C 218.2
# 12. To write a python program merge sort. C 218.2
# 13. To write a python program first n prime numbers. C 218.1
# 14. . To write a python program simulate bouncing ball in Pygame.
# 15.
# Write a Python program to compute area and circumference of a
# triangle. Take input from user.
# C 218.1
# 16.
# Write a program to check if a number is Odd or even. Take input
# from user.
# C 218.2
# 17.
# Write a program to check that a given year is Leap Year or not.
# C 218.3
# 18. Write a Python program to print ‘n terms of Fibonacci series
# using iteration.
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\1\program.py",
"w",
) as f:
f.write("# To write a python program that takes in command line\n")
f.write("# arguments as input and print the number of arguments.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\2\program.py",
"w",
) as f:
f.write("# To write a python program to perform Matrix Multiplication.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\3\program.py",
"w",
) as f:
f.write("# To write a python program to compute the GCD of two\n")
f.write("# numbers.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\4\program.py",
"w",
) as f:
f.write("# To write a python program to find the most frequent words in a\n")
f.write("# text file.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\5\program.py",
"w",
) as f:
f.write("# To write a python program find the square root of a number\n")
f.write("# (Newton’s method).\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\6\program.py",
"w",
) as f:
f.write("# To write a python program exponentiation (power of a number).\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\7\program.py",
"w",
) as f:
f.write("# To write a python program find the maximum of a list of\n")
f.write("# numbers.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\8\program.py",
"w",
) as f:
f.write("# To write a python program linear search.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\9\program.py",
"w",
) as f:
f.write("# To write a python program Binary search.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\10\program.py",
"w",
) as f:
f.write("# To write a python program selection sort.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\11\program.py",
"w",
) as f:
f.write("# To write a python program Insertion sort.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\12\program.py",
"w",
) as f:
f.write("# To write a python program merge sort.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\13\program.py",
"w",
) as f:
f.write("# To write a python program first n prime numbers.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\14\program.py",
"w",
) as f:
f.write("# To write a python program simulate bouncing ball in Pygame.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\15\program.py",
"w",
) as f:
f.write("# Write a Python program to compute area and circumference of a\n")
f.write("# triangle. Take input from user.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\16\program.py",
"w",
) as f:
f.write("# Write a program to check if a number is Odd or even. Take input\n")
f.write("# from user.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\17\program.py",
"w",
) as f:
f.write("# Write a program to check that a given year is Leap Year or not.\n")
with open(
r"C:\Users\hp\OneDrive\Documents\GitHub\PYTHON-LANGUAGE-PROGRAMMING-LAB--KCS-453--PROGRAMS\programs\18\program.py",
"w",
) as f:
f.write(
"#Write a Python program to print ‘n terms of Fibonacci series using iteration.\n"
)