Final Report of Industrial Training
Final Report of Industrial Training
INTRODUCTION
Python is a programming language that lets you work quickly and integrate
systems more efficiently.
1.3 Applications:
DATATYPES IN PYTHON
2.1 Datatypes
2.1.1 Numeric
Numeric data type represents the data which has numeric value.
Numeric value can be integer, floating number or even complex
numbers. These values are defined as int, float and complex class in
Python.
• Integers - This value is represented by int class. It contains
positive or negative whole numbers (without fraction or decimal).
In Python there is no limit to how long an integer value can be.
• Float – This value is represented by float class. It is a real
number with floating point representation. It is specified by a
decimal point.
2.1.2. String
A string is a collection of one or more characters put in a single quote or
double-quote
For example : x = “ABC”
2.1.3. List
The list is a combination of numbers, string, characters in one variable which
can be written as a list of comma-separated values (items) between square
brackets. It is mutable.
For Example - list1 = ['physics', 'chemistry', 1997, 2000] list2 = [1, 2, 3, 4, 5]
2.1.4. Tuples
Tuple is also an ordered collection of Python objects. The only difference
between tuple and list is that tuples are immutable i.e. tuples cannot be
modified after it is created. It is represented by tuple class.
For example – tup1 = ('physics', 'chemistry', 1997, 2000)
tup2 = (1, 2, 3, 4, 5)
2.1.5. Set
Set is an unordered collection of data type that is mutable and has no
duplicate elements.
For example – x = {1, 5, 4,3} //O.P = {1, 3, 4, 5}
2.1.6. Dictionary
Each key is separated from its value by a colon (:), the items are
separated by commas, and the whole thing is enclosed in curly braces.
Keys are unique within a dictionary while values may not be. The values
of a dictionary can be of any type, but the keys must be of an immutable
data type such as strings, numbers, or tuples.
For Exampledict = {‘Name’:’Zara’,’Age’:7,’Class’:’First’}
print(dict[‘Name’])
3.1 Variables
Python Variable is containers which store values. Python is not “statically typed”.
We do not need to declare variables before using them or declare their type. A
variable is created the moment we first assign a value to it. A Python variable is
a name given to a memory location. It is the basic unit of storage in a program.
3.2 Operators
3.2.1 Arithmetic Operators
It is mainly use to perform arithmetic operation or do simple
calculation like addition, subtraction, multiplication, division, modulus and
exponent, etc.
For Example -
print("\n ")
print ("1.Arithematic operators in Python :-")
x = 10
y=2
print(x,"+",y,"=",x+y) // Addition
print(x,"-",y,"=",x-y) //Subtraction
print(x,"*",y,"=",x*y) // Multiplication
print(x,"/",y,"=",x/y) // Division
print(x,"Mod",y,"=",x%y) //Modulus
print(x,"exp",y,"=",x**y) // Exponent
print(x)
x=x**3//Exponent
print(x)
x=12
x=x&3 //AND
print(x)
x=12
x=x|3 //OR
print(x)
x=12
x=x^3 //NOT
print(x)
x=12
x=x>>3 //Right Shift
print(x)
x=12
x=x<<3 //Left Shift
print(x)
x=3 //Equals to
print(x)
print("\n")
a) Identify Operator
Identity operators are used to compare the objects, not if they are equal, but
if they are actually the same object, with the same memory location.
For example –
print("Identified operators in python:-")
a = ["apple", "banana"]
b= ["apple", "banana"]
c=a
b) Membership Operator
Membership operators are used to test if a sequence is presented in an
object.
For example
print("\n")
print("Membership operators in python :-")
a = ["apple", "banana"]
print ("banana" in a)
print("banana" not in a)
3.3.3 if elif : - using this we can print many conditions in one program.
Example -
print("if elif statements in python ")
if s <10 :
print("Yes")
elif s == 10:
print("Yesssss")
else :
print("Noo")
print("\n")
3.4.2 For range between: - prints the value between the given range in
the list.
Example -
print("For Range between in list in python :- ")
y = [1,2,3,4,5]
for n in range(0,3):
print(n)
print ("\n")
print("For in Range in python :-")
for d in range (1, 10):
print(d)
print("\n")
4.1 Inheritance
The mechanism of deriving a new class from existing one is known as
Inheritance.
Inheritance can be of following types:
4.2 Polymorphism
The word polymorphism means having many forms. In programming,
polymorphism means the same function name (but different signatures) being
used for different types.
Example
def f (x, y):
print (x, y)
f(1,2)
f([1,2,3,4],(1,2,3,4))
f(“Stephan”, “D’Souza”)
4.3 Overloading
Overloading is the ability of a function or an operator to behave in different
ways based on the parameters that are passed to the function, or the operands
that the operator acts on.
Example -
class human:
def sayhello (self, name =None):
if name is not Name:
print ('hello' +name).
else:
print("hello")
obj = human
obj. Sayhello ()
obj. Sayhello ("Donald trump")
4.4 Overriding
Overriding is an ability of any object-oriented programming language that
allows a subclass or child class to provide a specific implementation of a
method that is already provided by one of its super-classes or parent classes.
When a method in a subclass has the same name, same parameters or signature
and same return type (or sub-type) as a method in its super-class, then the
method in the subclass is said to override the method in the super-class.
Example -
class A:
def x(self):
print('A')
class B (A):
def x(self):
print ('B')
class C(A):
def x(self):
print ('C')
class D(B,A):
def x(self):
print ("D')
y = D()
y.x()
A.x(y)
Ch
GUI (Graphical User Interface)
5.1 Installation
• To install Tkinter run the following command in command prompt .
pip install tk
5.2 Widgets
Button
Canvas
Check Button
Combo Box
Entry
Frame
Label
Label Frame
List Box
Menu
Menu button
Message
Notebook
Radio button
Scroll bar
Text
5.3 Buttons
import Tkinter as tk
no = tk.Tk()
B = tk. Button (no, text = “Hello”)
B. pack ()
no. mainloop ()
Chapter 6
Data Analysis and Visualization
⚫ Pandas provides two primary data structures: i) Series and ii) DataFrame
CODE:
import pandas as pd
# Creating a Series
data = [10, 20, 30, 40, 50]
series = pd.Series(data)
print(series)
CODE:
# Creating a DataFrame from a dictionary
data = {
'Name': ['Alice', 'Bob', 'Charlie', 'David'],
'Age': [25, 30, 22, 28],
'City': ['New York', 'San Francisco', 'Chicago', 'Los Angeles']
}
df = pd.DataFrame(data)
print(df)
I) Filtering Data:
⚫ Matplotlib and Seaborn are two popular Python libraries used for data
visualization. Matplotlib provides a versatile and customizable way to create
various types of plots, while Seaborn is built on top of Matplotlib and
simplifies the creation of complex statistical visualizations.
# Data
x = [1, 2, 3, 4, 5]
y = [10, 20, 15, 30, 25]
plt.plot(x, y, marker='o')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.title('Line Plot Example')
plt.grid(True)
plt.show()
# Data
categories = ['A', 'B', 'C', 'D']
values = [25, 40, 15, 20]
Chapter 7
Machine Learning and AI
I. Supervised Learning:
.
⚫ scikit-learn (sklearn): Widely used for ML tasks, providing various
algorithms and tools.
⚫ TensorFlow: Open-source deep learning framework by Google's Brain
Team.
⚫ PyTorch: Popular deep learning framework known for flexibility.
⚫ XGBoost: Efficient gradient boosting library for structured data tasks.
⚫ Keras: High-level neural network API (integrated into TensorFlow).
⚫ Pandas and NumPy: Fundamental libraries for data manipulation and
preparation.
⚫ Seaborn and Matplotlib: Data visualization libraries for analysis.
.
Chapter 8
Time-Table-Management-System
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import os, sys
sys.path.insert(0, 'windows/')
import timetable_stud
import timetable_fac
import sqlite3
def challenge():
conn = sqlite3.connect(r'files/timetable.db')
user = str(combo1.get())
if user == "Student":
cursor = conn.execute(f"SELECT PASSW, SECTION, NAME, ROLL FROM STUDENT
WHERE SID='{id_entry.get()}'")
cursor = list(cursor)
if len(cursor) == 0:
messagebox.showwarning('Bad id', 'No such user found!')
elif passw_entry.get() != cursor[0][0]:
messagebox.showerror('Bad pass', 'Incorret Password!')
else:
nw = tk.Tk()
tk.Label(
nw,
text=f'{cursor[0][2]}\tSection: {cursor[0][1]}\tRoll No.:
{cursor[0][3]}',
font=('Consolas', 12, 'italic'),
).pack()
m.destroy()
timetable_stud.student_tt_frame(nw, cursor[0][1])
nw.mainloop()
elif user == "Faculty":
cursor = conn.execute(f"SELECT PASSW, INI, NAME, EMAIL FROM FACULTY WHERE
FID='{id_entry.get()}'")
cursor = list(cursor)
if len(cursor) == 0:
messagebox.showwarning('Bad id', 'No such user found!')
elif passw_entry.get() != cursor[0][0]:
messagebox.showerror('Bad pass', 'Incorret Password!')
else:
nw = tk.Tk()
tk.Label(
nw,
text=f'{cursor[0][2]} ({cursor[0][1]})\tEmail: {cursor[0][3]}',
font=('Consolas', 12, 'italic'),
).pack()
m.destroy()
timetable_fac.fac_tt_frame(nw, cursor[0][1])
nw.mainloop()
elif user == "Admin":
if id_entry.get() == 'admin' and passw_entry.get() == 'admin':
m.destroy()
os.system('py windows\\admin_screen.py')
# sys.exit()
else:
messagebox.showerror('Bad Input', 'Incorret Username/Password!')
m = tk.Tk()
m.geometry('400x430')
m.title('Welcome')
tk.Label(
m,
text='TIMETABLE MANAGEMENT SYSTEM',
passw_entry.update()
pass_entry_f = tk.Frame()
pass_entry_f.pack()
# Entry2
passw_entry = tk.Entry(
pass_entry_f,
font=('Consolas', 12),
width=15,
show="●"
)
passw_entry.pack(side=tk.LEFT)
B1_show = tk.Button(
pass_entry_f,
text='○',
font=('Consolas', 12, 'bold'),
command=show_passw,
)
B1_show.pack(side=tk.LEFT, padx=15)
combo1 = ttk.Combobox(
m,
values=['Student', 'Faculty', 'Admin']
)
combo1.pack(pady=15)
combo1.current(0)
tk.Button(
m,
text='Login',
font=('Consolas', 12, 'bold'),
padx=30,
command=challenge
).pack(pady=10)
m.mainloop()
8.2 Output
Chapter 9
Weekly Diary
Chapter 10
Conclusion
In conclusion, the Time-Table Management System project developed using
Python provides an efficient and user-friendly solution for automating the
process of creating and managing academic timetables. The project aimed to
streamline the time-consuming and error-prone manual timetable generation
process prevalent in educational institutions.
⚫ References