0% found this document useful (0 votes)
314 views42 pages

Report

The document is an internship report submitted by Maddirala Jaya Krishna to Sri Venkateswara College of Engineering and Technology in partial fulfillment of the requirements for a Bachelor of Technology degree in Computer Science and Engineering. The report details Krishna's internship from August 18, 2023 to October 18, 2023 at YBI Foundation in Delhi, where he learned Python programming with a focus on data structures and algorithms. The report includes sections on the company profile, an overview of what was learned about Python and the projects completed, and conclusions from the internship experience.

Uploaded by

stephenedward359
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
314 views42 pages

Report

The document is an internship report submitted by Maddirala Jaya Krishna to Sri Venkateswara College of Engineering and Technology in partial fulfillment of the requirements for a Bachelor of Technology degree in Computer Science and Engineering. The report details Krishna's internship from August 18, 2023 to October 18, 2023 at YBI Foundation in Delhi, where he learned Python programming with a focus on data structures and algorithms. The report includes sections on the company profile, an overview of what was learned about Python and the projects completed, and conclusions from the internship experience.

Uploaded by

stephenedward359
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 42

Internship Report

On

Python Programming with Data Structures and Algorithms


In partial fulfillment for the award of the degree of
Bachelor of technology
In
Computer Science and Engineering
By

MADDIRALA JAYA KRISHNA


Regd.no:21781A0581

Under the guidance


of Name ,
Designation
YBI FOUNDATION , DELHI
Aug 18 2023 to Oct 18 2023

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY


(AUTONOMOUS)
R.V.S NAGAR, CHITTOOR-517 127(A.P)
(Approved by AICTE ,New Delhi , Approved by AICTE new Delhi , Accredited by
NAAC Affiliated to JNTUA ,Ananthapur)
CERTIFICATE
This is to certify that Internship report entitled “PYTHON PROGRAMMING WITH DATA
STRUCTURES AND ALGORITHMS” is the bonafide work done by the student in the sri
venkateswara college of engineering and technology is the bonafide work of “MADDIRALA
JAYA KRISHNA(Reg no: 21781A0581)”in partial fulfillment of the requirement of the
award of the BACHELOR OF TECHNOLOGY IN COMPUTER SCIENCE AND
ENGINEERING during the Academic Year 2023-2024

INTERNSHIP CO-ORDINATOR HEAD OF DEPARTMENT


MR.D.DHAYALAN DR.P.JYOTHEESWARI
M.Tech.,Ph.D

SRI VENKATESWARA COLLEGE OF ENGINEERING AND TECHNOLOGY


(AUTONOMOUS)
R.V.S NAGAR, CHITTOOR-517 127(A.P)
(Approved by AICTE ,New Delhi , Approved by AICTE new Delhi , Accredited by
NAAC Affiliated to JNTUA ,Ananthapur)
ACKNOWLEDGEMENT

This satisfaction that accompanies the successful completion of the task would be put
incomplete without the mention of the people who made it possible, whose constant guidance
and encouragement, crown the efforts with success.
We convey our gratitude to our esteemed management and honorable Principal,
Dr. M.MOHAN BABU and head of the department, DR.P.JYOTHEESWARI for providing all
the facilities and support.

We would like to thank Mr.D.DHAYALAN, Department Coordinator, Computer


Science and Engineering for providing us innovative ideas, motivating and inspiring us
throughout the completion of this internship..
I sincerely express my gratitude towards the YBI FOUNDATION for providing this
opportunity.
We also thank the teaching and non-teaching staff of our college for their valuable
guidance and constant support during the completion of this internship
We express our deep sense of gratitude to our parents and well-wishers who helped us
a lot in making this internship successful.

Date: MADDIRALA JAYA KRISHNA


Place: 21781A0581
B.TECH III rd
year CSE-A
TABLE OF CONTENTS

TITLE Page no.

Cover page i

Certificate ii-iii

Acknowledgment iv

Table of contents 1

1.0 Company Profile 2


2.0 Overview python and project work
2.1 Introduction to python 3-6
 learn how to install ,distinguish between important data types and
basic features of the python interpreter,IDLE.
2.2 Using Variables in python 7-10
 Learn about numeric,string,sequence and dictionary data types and
relevant operations while practicing python syntax.
2.3 Basics of programming in python 11-25
 Learn how to write programs using conditionals,loops,iterators and
generators,functions and modules and packages.
2.4 Principles of object oriented programming 26-29
 Learn about the important features of object oriented
programming while using classes and objects,two main aspects of
the oop paradigm.
2.5 Connecting to SQLite database 30-31
 Learn about relational databases while learning how to store and
retrieve data from and SQLite database through python.
2.6 project work 32-35
3.0 Conclusion 36
4.0 References 37

1
1. COMPANY

PROFILE About YBI FOUNDATION:

YBI Foundation is an internship and online training platform . It was founded by


ALOK YADAV, an IIT Madras alumnus, in 2010 , the website helps students find
internships with organizations in India.
History:

The platform which was founded in 2010, started as a WordPress blog that
aggregated internships across India and articles on education ,technology and skill
gap. YBI Foundation launced its online trainings in 2014. As of 2018, the platform
had
3.5 million students and 80,000 companies.

Awards And Recognition:

In 2011 , the website became a part of NAACOM 10k startups . In 2015


, YBI Foundation was a finalist in people Matters TechHR 2025 Spotlight Awards
under Futurism in Recruitment category.

2
2.0 PYTHON OVERVIEW AND PROJECT

2.1 Introduction to python

Python is a popular programming language. It was created by Guido Van Rossum ,


and released in 1991.

Python is widely used high level language, general purpose ,interpreted


programming language .

Python can connect to a database systems. It can also read and modify files.

It is used for:

 web development(server side),


 software development ,
 system scripting

Installation :

Visit the link https://www.python.org/downloads/

to download the latest release of python When we click on the above link, it will
bring us the following page.

Step - 1: Select the Python's version to download.

Click on the download button.

3
Step - 2: Click on the Install Now

Double-click the executable file, which is downloaded; the following window will
open. Select Customize installation and proceed. Click on the Add Path check box,
it will set the Python path automatically.

We can also click on the customize installation to choose desired location and
features. Other important thing is install launcher for the all user must be checked.

4
Step - 3 Installation in Process

Now, try to run python on the command prompt. Type the command python -
version in case of python3.

We are ready to work with the Python.

5
Features of python:

 Free and Open Source


 Easy to code
 Easy to Read
 Object-Oriented Language
 GUI Programming Support
 High-Level Language
 Extensible feature
 Easy to Debug

6
2.2 USING VARIABLES IN

PYTHON Learn about numeric :

In Python, numeric data type represent 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. Optionally, the character e or E
followed by a positive or negative integer may be appended to specify scientific
notation.
Complex Numbers :
Complex number is represented by complex class. It is specified as (real part) +
(imaginary part)j. For example – 2+3j
Note – type() function is used to determine the type of data type.

# Python program to numeric:

1. a = 5
2. print("Type of a: ",
type(a)) 3. b = 5.0
4. print("\nType of b: ", type(b))

5. c = 2 + 4j

7
6. print("\nType of c: ", type(c))

Output:
Type of a: <class 'int'>
Type of b: <class 'float'>
Type of c: <class 'complex'>
Strings and sequential :

Strings in python are surrounded by either single quotation marks, or double


quotation marks.

'hello' is the same as "hello".

You can display a string literal with the print() function:

Example:
print("Hello")
print('Hello')
output:
Hello
Hello
Assign String to a Variable:

Assigning a string to a variable is done with the variable name followed by an


equal sign and the string:

Example:

a= "Hello"
print(a)
8
output:

Hello

Multiline Strings:

You can assign a multiline string to a variable by using three quotes:

Example:

A=’’’A very good after noon sir, My name is sunil’’’


print(a)

output:

A very good after noon sir,My name is sunil.

Dictionary:

Dictionary is an unordered set of a key-value pair of items. It is like an associative


array or a hash table where each key stores a specific value. Key can hold any
primitive data type, whereas value is an arbitrary Python object.

The items in the dictionary are separated with the comma (,) and enclosed in the
curly braces {}.

Example:

1. d = {1:'Jimmy', 2:'Alex', 3:'john', 4:'mike'}


2. print (d)
3. # Accesing value using keys
4. print("1st name is "+d[1])
5. print("2nd name is "+ d[4])
6. print (d.keys())
7. print (d.values())

9
Output:

1st name is Jimmy


2nd name is mike
{1:'Jimmy', 2:'Alex', 3:'john',
4:'mike'} Dict keys([1,2,3,4,])
Dict values([‘Jimmy’,’Alex’,’john’,’mike’])

10
2.3 BASICS OF PROGRAMMING IN PYTHON

Conditionals:

Decision making is the most important aspect of almost all the programming
languages. As the name implies, decision making allows us to run a particular block
of code for a particular decision. Here, the decisions are made on the validity of
the particular conditions. Condition checking is the backbone of decision making.

In python, decision making is performed by the statements following:


Statement Description

If Statement The if statement is used to test a specific condition. If the condition


is true, a block of code (if-block) will be executed.

If - else The if-else statement is similar to if statement except the fact that,
Statement it also provides the block of the code for the false case of the
condition to be checked. If the condition provided in the if
statement is false, then the else statement will be executed.

Nested if Nested if statements enable us to use if ? else statement inside an


Statement outer if statement.

The if statement:

The if statement is used to test a particular condition and if the condition is true, it
executes a block of code known as if-block. The condition of if statement can be
any valid logical expression which can be either evaluated to true or false.

11
The syntax of the if-statement is given below.
if expression:
statement

Example 1:
num = int(input("enter the number?"))
if num%2 == 0:
print("Number is even")

Output:
enter the number?
10 Number is even

12
Example 2 : Program to print the largest of the three numbers.
1. a = int(input("Enter a? "));
2. b = int(input("Enter b? "));
3. c = int(input("Enter c? "));
4. if a>b and a>c:
5. print("a is largest");
6. if b>a and b>c:
7. print("b is largest");
8. if c>a and c>b:
9. print("c is largest");

Output:
Enter a? 100
Enter b? 120
Enter c? 130
c is largest

The if-else statement:

The if-else statement provides an else block combined with the if statement which
is executed in the false case of the condition.

If the condition is true, then the if-block is executed. Otherwise, the else-block is
executed.

13
The syntax of the if-else statement is given below.
if condition:
#block of statements
else:
#another block of statements (else-block)

14
Example 1 :

Program to check whether a person is eligible to vote or not.


age = int (input("Enter your age? "))
if age>=18:
print("You are eligible to vote !!");
else:
print("Sorry! you have to wait !!");

Output:
Enter your age? 90
You are eligible to vote !!
Example 2:

Program to check whether a number is even or not.


1. num = int(input("enter the
number?")) 2. if num%2 == 0:
3. print("Number is even...")
4. else:
5. print("Number is odd...")

Output:
enter the number?
10 Number is even

The elif statement:

The elif statement enables us to check multiple conditions and execute the specific
block of statements depending upon the true condition among them. We can have
any number of elif statements in our program depending upon our need. However,
using elif is optional.

15
The elif statement works like an if-else-if ladder statement in C. It must be
succeeded by an if statement.

The syntax of the elif statement is given below.


if expression 1:
# block of statements

elif expression 2:
# block of statements

elif expression 3:
# block of statements

else:
# block of statements

Example :

1. Example 1
2. number = int(input("Enter the number?"))
3. if number==10:
4. print("number is equals to 10")
5. elif number==50:
6. print("number is equal to 50");
7. elif number==100:
8. print("number is equal to 100");
9. else:
10. print("number is not equal to 10, 50 or 100");

Output:

16
Enter the number?15
number is not equal to 10, 50 or 100

LOOPS:

The following loops are available in Python to fulfil the looping needs. Python
offers 3 choices for running the loops. The basic functionality of all the techniques
is the same, although the syntax and the amount of time required for checking the
condition differ.

We can run a single statement or set of statements repeatedly using a loop


command.

The following sorts of loops are available in the Python programming language.

Sr.No. Name of Loop Type & Description


the loop

1 While loop Repeats a statement or group of statements while a given


condition is TRUE. It tests the condition before executing the
loop body.

2 For loop This type of loop executes a code block multiple times and
abbreviates the code that manages the loop variable.

3 Nested We can iterate a loop inside another loop.


loops

17
Loop statements:

Statements used to control loops and change the course of iteration are called
control statements. All the objects produced within the local scope of the loop are
deleted when execution is completed.

Let us quickly go over the definitions of these loop control statements.

Sr.No. Name of the Description


control
statement

1 Break This command terminates the loop's execution and


statement transfers the program's control to the statement next
to the loop.

2 Continue This command skips the current iteration of the loop.


statement The statements following the continue statement are
not executed once the Python interpreter reaches the
continue statement.

3 Pass statement The pass statement is used when a statement is


syntactically necessary, but no code is to be executed.

The for Loop:

Python's for loop is designed to repeatedly execute a code block while iterating
through a list, tuple, dictionary, or other iterable objects of Python. The process of
traversing a sequence is known as iteration.

18
Syntax of the for Loop:

for value in sequence:


{ code block }

Code:

# Python program to show how the for loop works

1. # Creating a sequence which is a tuple of numbers


2. numbers = [4, 2, 6, 7, 3, 5, 8, 10, 6, 1, 9, 2]

3. # variable to store the square of the number


4. square = 0

5. # Creating an empty list


6. squares = []

7. # Creating a for loop


8. for value in numbers:
9. square = value ** 2
10. squares.append(square)
11. print("The list of squares is", squares)

Output:

The list of squares is [16, 4, 36, 49, 9, 25, 64, 100, 36, 1, 81, 4]

19
Using else Statement with for Loop:

As already said, a for loop executes the code block until the sequence element is
reached. The statement is written right after the for loop is executed after the
execution of the for loop is complete.

Only if the execution is complete does the else statement comes into play. It won't
be executed if we exit the loop or if an error is thrown.

Here is a code to better understand if-else statements.

Code

1. # Python program to show how if-else statements work

2. string = "Python Loop"

3. # Initiating a loop
4. for s in a string:
5. # giving a condition in if
block 6. if s == "o":
7. print("If block")
8. # if condition is not satisfied then else block will be executed
9. else:
10. print(s)

Output:

P
y
t
h
If block
20
n

L
If block
If block
p

Now similarly, using else with for loop.

Syntax:

for value in sequence:


# executes the statements until sequences are exhausted
else:
# executes these statements when for loop is completed

Code:

# Python program to show how to use else statement with for loop

# Creating a sequence
tuple_ = (3, 4, 6, 8, 9, 2, 3, 8, 9, 7)

# Initiating the
loop
for value in tuple_:
if value % 2 != 0:
print(value)
# giving an else statement
else:
print("These are the odd numbers present in the tuple")

Output:
21
3
9
3
9
7
These are the odd numbers present in the tuple
The range() Function:

With the help of the range() function, we may produce a series of numbers.
range(10) will produce values between 0 and 9. (10 numbers).

We can give specific start, stop, and step size values in the manner range(start,
stop, step size).

The example that follows will make this clear.

Code

1. # Python program to show the working of range() function

2. print(range(15))

3. print(list(range(15)))

4. print(list(range(4, 9)))

5. print(list(range(5, 25, 4)))

Output:

range(0, 15)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]
[4, 5, 6, 7, 8]
22
[5, 9, 13, 17, 21]

To iterate through a sequence of items, we can apply the range() method in for
loops. We can use indexing to iterate through the given sequence by combining it
with an iterable's len() function. Here's an illustration.

Code:

1. # Python program to iterate over a sequence with the help of indexing

2. tuple_ = ("Python", "Loops", "Sequence", "Condition", "Range")

3. # iterating over tuple_ using range() function


4. for iterator in range(len(tuple_)):
5. print(tuple_[iterator].upper())

Output:

PYTHON
LOOPS
SEQUENCE
CONDITION
RANGE

While Loop:

While loops are used in Python to iterate until a specified condition is met.
However, the statement in the program that follows the while loop is executed
once the condition changes to false.

Syntax of the while loop is:

while <condition>:
{ code block}
23
Example:
1. # Python program to show how to use a while loop
2. counter = 0
3. # Initiating the loop
4. while counter < 10: # giving the condition
5. counter = counter + 3
6. print("Python Loops")

Output:

Python Loops
Python Loops
Python Loops
Python Loops

Using else Statement with while

Loop. Code:

1. #Python program to show how to use else statement with the while loop
2. counter = 0

3. # Iterating through the while loop


4. while (counter < 10):
5. counter = counter + 3
6. print("Python Loops") # Executed untile condition is met
7. # Once the condition of while loop gives False this statement will be
execute d
8. else:
9. print("Code block inside the else statement")

Output:
24
Python Loops
Python Loops
Python Loops
Python Loops
Code block inside the else statement

25
2.4 PRINCIPLES OF OBJECT ORIENTED PROGRAMMING

Like other general-purpose programming languages, Python is also an object-


oriented language since its beginning. It allows us to develop applications using an
Object-Oriented approach. In Python, we can easily create and use classes and
objects.

An object-oriented paradigm is to design the program using classes and objects.


The object is related to real-word entities such as book, house, pencil, etc. The
oops concept focuses on writing the reusable code. It is a widespread technique to
solve the problem by creating objects.

Major principles of object-oriented programming system are given below.

o Class
o Object
o Method
o Inheritance
o Polymorphism
o Data Abstraction
o Encapsulation

Class:

The class can be defined as a collection of objects. It is a logical entity that has
some specific attributes and methods. For example: if you have an employee class,
then it should contain an attribute and method, i.e. an email id, name, age, salary,
etc.

26
Syntax:

class ClassName:
<statement-1>
.
.
<statement-N>

Object:

The object is an entity that has state and behavior. It may be any real-world object
like the mouse, keyboard, chair, table, pen, etc.

Everything in Python is an object, and almost everything has attributes and


methods. All functions have a built-in attribute doc , which returns the docstring
defined in the function source code.

When we define a class, it needs to create an object to allocate the memory.


Consider the following example.

Example:

class car:
def init (self,modelname,
year): self.modelname =
modelname self.year = year
def display(self):
print(self.modelname,self.year)

c1 = car("Toyota", 2016)
c1.display()

Output:

27
Toyota 2016

Method:

The method is a function that is associated with an object. In Python, a method is


not unique to class instances. Any object type can have methods.

Inheritance:

Inheritance is the most important aspect of object-oriented programming, which


simulates the real-world concept of inheritance. It specifies that the child object
acquires all the properties and behaviors of the parent object.

By using inheritance, we can create a class which uses all the properties and
behavior of another class. The new class is known as a derived class or child class,
and the one whose properties are acquired is known as a base class or parent
class.

It provides the re-usability of the code.

Polymorphism:

Polymorphism contains two words "poly" and "morphs". Poly means many, and
morph means shape. By polymorphism, we understand that one task can be
performed in different ways. For example - you have a class animal, and all animals
speak. But they speak differently. Here, the "speak" behavior is polymorphic in a
sense and depends on the animal. So, the abstract "animal" concept does not
actually "speak", but specific animals (like dogs and cats) have a concrete
implementation of the action "speak".

28
Encapsulation:

Encapsulation is also an essential aspect of object-oriented programming. It is used


to restrict access to methods and variables. In encapsulation, code and data are
wrapped together within a single unit from being modified by accident.

Data Abstraction:

Data abstraction and encapsulation both are often used as synonyms. Both are
nearly synonyms because data abstraction is achieved through encapsulation.

Abstraction is used to hide internal details and show only functionalities.


Abstracting something means to give names to things so that the name captures
the core of what a function or a whole program does.

29
2.5 CONNECTING TO SQLITE DATABASE

Connecting to the SQLite Database can be established using the


connect() method, passing the name of the database to be accessed as a
parameter. If that database does not exist, then it’ll be created.
sqliteConnection = sqlite3.connect('sql.db')
But what if you want to execute some queries after the connection is being
made. For that, a cursor has to be created using the cursor() method on the
connection instance, which will execute our SQL queries.
cursor = sqliteConnection.cursor()
print('DB Init')
The SQL query to be executed can be written in form of a string, and then
executed by calling the execute() method on the cursor object. Then, the result
can be fetched from the server by using the fetchall() method, which in this case,
is the SQLite Version Number.
query = 'SQL query;'
cursor.execute(query)
result = cursor.fetchall()
print('SQLite Version is {}'.format(result))

Consider the below example where we will connect to an SQLite database and
will run a simple query select sqlite_version(); to find the version of the SQLite we
are using.
Example:

import sqlite3

try:

sqliteConnection = sqlite3.connect('sql.db')

30
cursor = sqliteConnection.cursor()

print('DB Init')

query = 'select

sqlite_version();'

cursor.execute(query)

result = cursor.fetchall()

print('SQLite Version is {}'.format(result))

cursor.close()

except sqlite3.Error as error:

print('Error occured –

‘,error)

finally:

if sqliteConnection:

sqliteConnection.close()

print('SQLite Connection

closed')

31
Output:

32
2.6 .PROJECT
Create a Fantasy Cricket game in Python. The game should have all the features
displayed in the mock-up screens in the scenario. To calculate the points for each
player, we can use rules similar to the sample rules displayed below.
Sample of Rules:
Batting
● 1 point for 2 runs scored
● Additional 5 points for half century
● Additional 10 points for century
● 2 points for strike rate (runs/balls faced) of 80-100
● Additional 4 points for strike rate>100
● 1 point for hitting a boundary (four) and 2 points for over boundary (six)
Bowling:
● 10 points for each wicket
● Additional 5 points for three wickets per innings
● Additional 10 points for 5 wickets or more in innings
● 4 points for economy rate (runs given per over) between 3.5 and 4.5
● 7 points for economy rate between 2 and 3.5
● 10 points for economy rate less than 2
Fielding:
● 10 points each for catch/stumping/run out

You can check the DataBase created for this Game named Fantasycricket.db.

To execute this program, we need to install PyQt5 which is a Python GUI Library.
And that’s, we are all set to run this program.

If we want to make changes in the “evaluate teams” which is present in the


evaluation module, we can change manually by just editing the code, but the

33
edited code will not reflect back to the main GUI. To execute the edited “evaluate
teams” code, we need to install the evaluation module.

Instruction to install :-

1. Inside the evaluation folder, we will see the evaluation folder.

2. Open cmd to that location, and type “pip install evaluation”.

3. That’s it. Edited “evaluate teams” code will be reflected back to the main GUI.

34
Collecting Evaluation and downloading files:-

In this project, we can create a team based on our Points, We can save the team,
We can view our team, we can modify our team, we can delete our existing team
and we can evaluate the team.

Main files:-

35
Main files:

Options to fill the essential details about player and to get result

Step 1:- Create Team ie-players details

Step 2 :- Evaluate Team ie- players are valid or

not Step 3:-Open Team

Step 4 :- See Scores

Column to insert Players name:

36
3.0 conclusion

1. I believe that trail has shown conclusively that it is both possible and desirable
to use python as the principle teaching language.
2. It is free (as in both cost and source code).

3. It is trivial to install on windows PC allowing students to take their interest


further. For many the hurdle of installing a pascal or C Compiler on a windows
machine is either too expensive or too complicated.
4. Most importantly, it’s clean syntax offers increased understanding and
enjoyment for students.

37
4.0 REFERENCES

 https://trainings.internshala.com/dashboard/
 https://www.w3schools.com/
 https://internship.aicte-india.org/login_new.php
 https://learn.verzeo.in/users/sign_in

38

You might also like