CS Programme
CS Programme
INDEX
SN TOPIC PAGE SIGNATUR
O. NO. E
PYTHON PROGRAMS
1 W.A.P that calculates and prints the
number of seconds in a year.
2 W.A.P that reads a date as an integer
in the format MMDDYYYY. The
program will call a function that
prints print out the date in the format
<Monthname> <day> < year>.
3 W.A.P that reads two times in
military format (0900,1730) and
prints the number of hours and
minutes between the two times.
4 W.A.P that creates a tuple storing
first 9 terms of Fibonacci Series.
5 Create a dictionary whose keys are
months names and whose values are
the number of days in the
corresponding months.
print(remove_letter(sentence, letter))
OUTPUT
file = open("D:\Poem.txt","r")
Counter = 0
Content = file.read()
CoList = Content.split("\n")
for i in CoList:
if i:
Counter += 1
import os
file_size = os.stat('D:/Poem.txt')
print("Size of file :", file_size.st_size, "bytes")
OUTPUT
mydb = mysql.connector.connect(
host="localhost",
user="yourusername",
password="yourpassword",
database="mydatabase"
)
mycursor = mydb.cursor()
I
N
T
UnitsOnO S 2
rder M
A
L
L
I
N
T
ReorderL S 2
evel M
A
L
L
I
N
T