Python
Python
Certificate
This is to certify that Miss Ballal Janhavi Ananda has satisfactorily carried out
the required practical work prescribed by the Shivaji University Kolhapur for BCA
Part –III course Python Programming subject this journal represents his bonafide work
during the academic year 2023-24
PRN No.
Date:
Place: Kagal
Teacher In charge
H. O. D. Principal
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Program to create a list of 100 numbers and separate those numbers in two
4
different list one includes odd number other even.
5 Program to display maximum number and minimum number from given list
PYTHON PROGRAMMING
Code:
name = input("Enter name : ")
print("Hi, my name is " + name + ", and I proper address " + address + ", content
number " + number)
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
num1 = 20;
num2 = 30;
sum = num1+num2;
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
n = int (input ("Enter a number:"))
fact = 1
if n >= 1:
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
4.Program to create a list of 100 numbers and separate those numbers in two
different list one includes odd number other even.
Code:
list1 = [10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,100]
listOdd = []
listEven = []
fornum in list1:
ifnum % 2 == 0:
listEven.append(num)
else:
listOdd.append(num)
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
5. Program to display maximum number and minimum number from given list
Code:
num = [12, 65, 54, 39, 102, 37, 72, 33, 5, -28, 0, 15]
print(min(num))
print(max (num))
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
my_str = "Python_the_simple_language"
result1 = my_str[slice1]
# Displaying result
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
# define three sets
E = {0, 2, 4, 6, 8};
N = {1, 2, 3, 4, 5};
# set union
# set intersection
# set difference
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
#from datetime import datetime
today = datetime.today()
#now = datetime.now()
# dd/mm/YY H:M:S
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
fromdatetime import date
current_date = date.today()
current_date = date.today()
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
now = datetime.now()
year = now.strftime("%Y")
print("year:", year)
month = now.strftime("%m")
print("month:", month)
#Full_month_name = now.strftime(("%B")
#print("Full_month_name :",Full_month_name)
day = now.strftime("%d")
print("day:", day)
time = now.strftime("%H:%M:%S")
print("time:", time)
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
import calendar
print(calendar.month(y, m))
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
import calendar
print(calendar.month(y, m))
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
# open a file
read_content = file1.read()
print(read_content)
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
# writing to file
# Opening a file
s = "PYHON:\n"
file1.write(s)
# at a time
file1.writelines(L)
# Closing files
file1.close()
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
print(file1.read())
file1.close()
Output:
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
Code:
# Python GUI program to
def add_numbers():
label_text.set(res)
window = Tk()
label_text = StringVar();
e1 = Entry(window)
THE KAGAL EDUCATION SOCIETY’S
PYTHON PROGRAMMING
e2 = Entry(window)
e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
mainloop()
Output: