Model Inter Report
Model Inter Report
INTERNSHIP REPORT
Submitted by
SEENIVASAN A 717822F249
BACHELOR OF TECHNOLOGY
in
INFORMATION TECHNOLOGY
DEC - 2023
CERTIFICATE
2023 – 2024 academic year, in partial fulfillment of the requirements for the
TECHNOLOGY.
…………………… …………..……
Department Internship Coordinator Head of the Department
Certified that the candidate was examined in the viva-voce examination held on ……………..
…………………….. ……………………
Examiner 1 Examiner 2
INTERNSHIP CERTIFICATE
ACKNOWLEDGEMENT
Managing Trustee, Karpagam Educational Institutions for providing us with all sorts
Principal Dr. KUMAR CHINNAIYAN V, M.E., Ph.D., for his guidance and
Head of the Department Dr. N M SARAVANA KUMAR, M.E., Ph.D., for his
remarkable guidance and besides his positive approach he has offered incessant help
We would also like to recollect the courage and enthusiasm that was inculcated
We also extend our thanks to other faculty members, parents and friends
TUESDAY
23-08-2023 WEDNESDAY DICTIONARY
24-08-2023 THURSDAY SET
25-08-2023 FRIDAY SET
MONDAY
29-08-2023 TUESDAY LAMBDA FUNCTION
30-08-2023 WEDNESDAY OBJECT ORIENTED PROGRAMMING
31-08-2023 THURSDAY OBJECT ORIENTED PROGRAMMING
TABLE OF CONTENTS
CHAPTER TITLE PAGE NO
NO
ABSTRACT i
LIST OF FIGURES ii
LIST OF TABLES iii
1 INTRODUCTION 1
1.1 PYTHON 1
1.2 HISTORY OF PYTHON 1
1.3 FEATURES OF PYTHON 1
2 KEYWORDS AND IDENTIFIERS 2
2.1 INTRODUCTION TO KEYWORDS 2
2.1.1 LIST OF KEYWORDS 2
2.2 IDENTIFIERS 7
2.2.1 RULES 8
2.2.2 EXAMPLES 8
3 OPERATORS 9
3.1 TYPES OF OPERATORS 9
3.2 ARITHEMATIC OPERATORS 9
3.3 COMPARISION OPERATOR 10
3.4 LOGICAL OPERATORS 11
3.5 BITWISE OPERATORS 12
3.6 ASSIGNMENT OPERATOR 13
3.7 IDENTITY OPERATOR 15
3.8 MEMBERSHIP OPERATOR 15
4 DATA TYPES 16
4.1 type() FUNCTION 17
4.2 NUMERIC DATA TYPES 17
4.3 SEQUENCE DATA TYPE 17
4.3.1 STRING DATA TYPE 18
4.3.2 LIST DATA TYPE 18
4.3.3 TUPLE 18
4.4 SET 18
4.5 DICTIONARY 19
4.6 BOOLEAN 19
5 LOOPS 20
5.1 INTRODUCTION 20
5.2 WHILE LOOP 20
5.2.1 USING ELSE STATEMENT 20
5.3 FOR LOOP 21
5.3.1 FOR USING ELSE 21
5.3.2 NESTED LOOPS 22
5.4 LOOP CONTROL STATEMENTS 22
5.4.1 CONTINUE STATEMENT 22
5.4.2 BREAK STATEMENT 22
5.4.3 PASS STATEMENT 22
6 LISTS 23
6.1 INTRODUCTION 23
6.2 FEATURES OF LIST 23
6.3 CREATING A LIST 23
6.4 LIST FUNCTIONS 24
6.5 ACCESSING ITEMS 25
6.6 MODIFYING LIST 26
7 TUPLES 28
7.1 INTRODUCTION 28
7.2 CREATING TUPLES 28
7.3 ROUND BRACKETS () 28
7.4 TUPLE WITH ONE ITEM 29
7.5 TUPLE CONSTRUCTOR 29
7.6 FEATURES OF TUPLES 30
7.7 CHARACTERISTICS OF TUPLES 30
7.8 TUPLE OPERATIONS 31
7.8.1 CONCATENATION 31
7.8.2 NESTING 32
7.8.3 REPETITION 32
7.8.4 SLICING 33
7.8.5 DELETING A TUPLE 33
7.8.6 FINDING THE LENGTH 34
7.8.7 MULTIPLE DATA TYPES 35
7.8.8 LIST TO A TUPLE 35
7.8.9 TUPLES IN A LOOP 36
8 CONCLUSION 37
ABSTRACT
This report encapsulates the enriching experience gained during the Bytes
Learning internship, focused on Python programming. The internship aimed to
empower participants with a comprehensive understanding of Python and its
applications in the realm of education technology. The report outlines the key
components of the internship, including the curriculum, hands-on projects, and
collaborative learning environment.
i
LIST OF FIGURES
ii
LIST OF TABLES
2.1 Keywords 2
iii
CHAPTER 1
INTRODUCTION
1.1 PYTHON
Python is a widely used high-level, general-purpose, interpreted, dynamic
programming language.
Its design philosophy emphasizes code readability, and its syntax allows
programmers to express concepts in fewer lines of code than would be possible in
languages such as C++ or Java.
The language provides constructs intended to enable clear programs on both a small
and large scale.
1
CHAPTER 2
2
pass is used
when the
To import
Break out a user doesn’t
break from specific parts pass
Loop want any
of a module
code to
execute
Represents
It is used to It is used to an
def define the import import a True expression
Function module that will
result in true.
It is used to
It is used to Try is used
test if two
del delete an is try to handle
variables are
object errors
equal
To check if a While Loop
Conditional
value is is used to
statements,
elif in present in a while execute a
same as else- Tuple, List, block of
if etc. statements
with
Used to
It is used in a statement is
create an
else conditional lambda with used in
anonymous
statement exception
function
handling
3
yield
try-except is keyword is
used to It represents used to
except None yield
handle these a null value create a
errors generator
function
EXAMPLE
Code:
# Logical Constants
print(True) # True
print(False) # False
print(None) # None
# Boolean Operators
result_and = True and False
result_or = True or False
result_not = not True
print(result_and) # False
print(result_or) # True
print(result_not) # False
# Conditional Statements
if True:
print("This block will be executed.")
# Looping
4
for i in range(3):
print(i)
# Function Definition
def my_function(parameter):
print("Function called with:", parameter)
my_function("Hello")
# Exception Handling
try:
result = 10 / 0
except ZeroDivisionError:
print("Cannot divide by zero.")
# Class Definition
class MyClass:
def _init_(self):
print("An instance of MyClass is created.")
obj = MyClass()
# Importing Modules
import math
print(math.sqrt(25)) # 5.0
# Lambda Functions
square = lambda x: x ** 2
print(square(4)) # 16
gen = my_generator()
print(next(gen)) # 1
print(next(gen)) # 2
6
Output:
2.2 IDENTIFIERS
number = 20
1. While declaring a variable, you need to make sure that it starts with a letter or
an underscore. For example _number, Number_, Str, etc are all valid names
for variables.
7
2. You cannot start the name of your variable with a number. 7Str_ is not a valid
variable.
3. You cannot include special characters in the variables such as $, &, %, etc.
You can use only alphanumeric characters.
4. Variable names in Python are always case-sensitive. This is why NUMBER
and number are two different names.
2.2.1 RULES
2.2.2 EXAMPLES
Valid Identifiers Invalid Identifiers
score @core
return_value return
highest_score highest score
name1 1name
convet_to_string convet to_string
8
CHAPTER 3
OPERATORS
9
Operator Description Syntax
Addition: adds two
+ x+y
Operands
Subtraction: subtracts two
– x–y
Operands
Multiplication: multiplies
* x*y
two operands
Division (float): divides
/ the first operand by the x/y
Second
Division (floor): divides
// the first operand by the x // y
Second
Modulus: returns the
remainder when the first
% x%y
operand is divided by the
second
Power: Returns first raised
** x ** y
to power second
Table 3.1 Arithmetic Operators
10
Operator Description Syntax
Greater than: True if the left
> operand is greater than the x>y
right
Less than: True if the left
< x<y
operand is less than the right
Equal to: True if both
== x == y
operands are equal
Not equal to – True if
!= x != y
operands are not equal
Greater than or equal to True
>= if the left operand is greater x >= y
than or equal to the right
Less than or equal to True if
<= the left operand is less than or x <= y
equal to the right
11
Operator Description Syntax
12
3.6 ASSIGNMENT OPERATOR
Python Assignment operators are used to assign values to the variables.
Operator Description Syntax
Assign the value of the
right side of the
= x=y+z
expression to the left side
operand
Add right-side operand
with left-side operandand
+= a+=b a=a+b
then assign to left
operand
Subtract right operand
from left operand and
-= a-=b a=a-b
then assign to left
operand
Divide AND: Divide left
operand with right
/= a/=b a=a/b
operand and then assign
to left operand
Modulus AND: Takes
modulus using left and
%= a%=b a=a%b
right operands and assign
the result to left operand
13
Divide(floor) AND:
Divide left operand with
//= right operand and then a//=b a=a//b
assign the value(floor) to
left operand
Exponent AND:
Calculate exponent(raise
**= power) value using a**=b a=a**b
operands and assign value
to left operand
Performs Bitwise OR on
|= operands and assign value a|=b a=a|b
to left operand
Performs Bitwise xOR on
^= operands and assign value a^=b a=a^b
to left operand
Performs Bitwise right
shift on operands and
>>= a>>=b a=a>>b
assign value to left
operand
14
Performs Bitwise left
shift on operands and
<<= a <<= b a= a << b
assign value to left
operand
Table 3.5 Assignment Operator
15
CHAPTER 4
DATA TYPES
16
4.1 type() FUNCTION
To define the values of various data types and check their data types we use
the type() function.
17
Tuple
4.3.1 STRING DATA TYPE
Strings in Python are arrays of bytes representing Unicode characters. A string
is a collection of one or more characters put in a single quote, double-quote, or triple-
quote. In Python there is no character data type, a character is a string of length one.
It is represented by str class.
Strings in Python can be created using single quotes, double quotes, or even triple
quotes.
4.3.3 TUPLE
Just like a list, a tuple is also an ordered collection of Python objects. The only
difference between a tuple and a list is that tuples are immutable i.e. tuples cannot
be modified after it is created. It is represented by a tuple class.
4.4 SET
18
4.5 DICTIONARY
4.6 BOOLEAN
Data type with one of the two built-in values, True or False. Boolean objects
that are equal to True are truthy (true), and those equal to False are falsy (false).
However non-Boolean objects can be evaluated in a Boolean context as well and
determined to be true or false. It is denoted by the class bool.
Note – True and False with capital ‘T’ and ‘F’ are valid booleans otherwise python
will throw an error.
19
CHAPTER 5
LOOPS
5.1 INTRODUCTION
programming language provides two types of loops – For loop and While
loop to handle looping requirements. Python provides three ways for executing the
loops.
While all the ways provide similar basic functionality, they differ in their syntax and
condition-checking time.
20
SYNTAX:
while condition:
# execute these statements
else:
# execute these statements
21
5.3.2 NESTED LOOPS
Python programming language allows to use one loop inside another loop
which is called nested loop. Following section shows few examples to illustrate the
concept.
SYNTAX:
for iterator_var in sequence:
for iterator_var in sequence:
statements(s)
statements(s)
22
CHAPTER 6
LISTS
6.1 INTRODUCTION
Lists are used to store multiple items in a single variable. Lists are one of 4
built-in data types in Python used to store collections of data, the other 3 are Tuple,
Set, and Dictionary, all with different qualities and usage. It is one of the collections
in python.
Ordered
Changeable
Allow Duplicates
Mutable
Eg:
23
Eg:
listB = list()
There are various types of functions that can be used with lists. They are
Method Description
append() Adds an element at the end of the list.
extend() Add the elements of a list (or any iterable), to the end of the current
list.
index() Returns the index of the first element with the specified value.
24
6.5 ACCESSING ITEMS
List items are indexed and you can access them by referring to the index number.
There are two ways to access using index,
Positive indexing
Negative indexing
Positive indexing:
Eg:
Negative indexing:
Negative indexing means start from the end. -1 refers to the last item, -2 refers
to the second last item etc.
Eg:
Range of Indexes:
25
Eg:
Append items:
To add an item to the end of the list, use the append() method:
Eg:
Eg:
26
Change a Range of Item Values:
To change the value of items within a specific range, define a list with the new
values, and refer to the range of index numbers where you want to insert the new
values:
Eg:
print(thislist)
27
CHAPTER 7
TUPLES
7.1 INTRODUCTION
Python Tuple is a collection of objects separated by commas. In some ways,
a tuple is similar to a Python list in terms of indexing, nested objects, and repetition
but the main difference between both is Python tuple is immutable, unlike the Python
list which is mutable.
Eg:
print(var)
28
Output:
Eg:
print(values)
Output:
(1, 2, 4, 'Geek')
To create a tuple with a Tuple constructor, we will pass the elements as its
parameters.
Eg:
print(tuple_constructor)
Output :
29
7.6 FEATURES OF TUPLES OVER SET
Tuples are
Immutable
Ordered
Allow Duplicates
We can find items in a tuple since finding any item does not make changes in
the tuple.
One cannot add items to a tuple once it is created.
Tuples cannot be appended or extended.
We cannot remove items from a tuple once it is created.
Eg:
mytuple = (1, 2, 3, 4, 5)
print(mytuple[1])
print(mytuple[4])
mytuple = (1, 2, 3, 4, 2, 3)
print(mytuple)
mytuple[1] = 100
print(mytuple)
30
Output:
(1, 2, 3, 4, 2, 3)
tuple1[1] = 100
Concatenation
Nesting
Repetition
Slicing
Deleting
Finding the length
Multiple Data Types with tuples
Conversion of lists to tuples
Tuples in a Loop
7.8.1 CONCATENATION
31
Eg:
tuple1 = (0, 1, 2, 3)
print(tuple1 + tuple2)
Output:
7.8.2 NESTING
Eg:
tuple1 = (0, 1, 2, 3)
print(tuple3)
Output :
7.8.3 REPETITION
We can create a tuple of multiple same elements from a single element in that
tuple.
32
Program:
tuple3 = ('python',)*3
print(tuple3)
Output:
7.8.4 SLICING
Slicing a Python tuple means dividing a tuple into small tuples using the
indexing method.
Program:
tuple1 = (0 ,1, 2, 3)
print(tuple1[1:])
print(tuple1[::-1])
print(tuple1[2:4])
Output:
(1, 2, 3)
(3, 2, 1, 0)
(2, 3)
33
7.8.5 DELETING A TUPLE
Program:
tuple3 = ( 0, 1)
del tuple3
print(tuple3)
Output:
print(tuple3)
Note: Remove individual tuple elements is not possible, but we can delete the whole
Tuple using Del keyword.
To find the length of a tuple, we can use Python’s len() function and pass the
tuple as the parameter.
Program:
34
print(len(tuple2))
Output:
Program:
tuple_obj = ("immutable",True,23)
print(tuple_obj)
Output :
We can convert a list in Python to a tuple by using the tuple() constructor and
passing the list as its parameters.
Program:
list1 = [0, 1, 2]
print(tuple(list1))
print(tuple('python'))
35
Output:
(0, 1, 2)
Note: Tuples take a single parameter which may be a list, string, set, or even a
dictionary(only keys are taken as elements), and converts them to a tuple.
Program:
tup = ('geek',)
n=5
for i in range(int(n)):
tup = (tup,)
print(tup)
Output:
(('geek',),)
((('geek',),),)
(((('geek',),),),)
((((('geek',),),),)
36
CHAPTER 8
CONCLUSION
The Python learning experience at Bytes Learning has been both enriching
and impactful, providing a comprehensive exploration of the language's versatility
and applications. Throughout the learning journey, a diverse range of topics has been
covered, spanning from fundamental concepts to advanced features and best
practices in Python programming.
One of the key strengths of Bytes Learning's Python program lies in its well-
structured curriculum. The program effectively navigated through the basics of
Python syntax, data structures, and control flow, gradually progressing towards more
advanced topics such as object-oriented programming, file handling, and working
with external libraries. This structured approach has facilitated a holistic
understanding of Python, empowering learners to tackle complex programming
challenges.
The mentorship and support provided by the Bytes Learning instructors have
been commendable. The guidance offered by experienced professionals has been
instrumental in addressing queries, clarifying concepts, and fostering a collaborative
learning environment. Regular feedback sessions have further enhanced the learning
experience, ensuring continuous improvement and refinement of coding skills.
37
REFERENCES
TEXTBOOKS REFERENCES
1. "Python Crash Course" by Eric Matthes
2. "The python programming" by John M Zelle
WEB REFERENCES
1. Official Python Documentation: -
[PythonDocumentation](https://docs.python.org/3/)
2. Tutorials and Guides: - [Real Python](https://realpython.com/) -
[Geeks for Geeks Python Programming Language]
(https://www.geeksforgeeks.org/python-programming-language/)
3. Community Resources: - [Stack
Overflow](https://stackoverflow.com/questions/tagged/python) -
[Python Reddit Community](https://www.reddit.com/r/Python/)
4. Online Learning Platforms: - [Code academy Python
Course](https://www.codecademy.com/learn/learnpython3) -
[Coursera Python for Everybody Specialization]
(https://www.coursera.org/specializations/python)
38