[go: up one dir, main page]

0% found this document useful (0 votes)
51 views44 pages

Internship Report Format

The document is an internship report submitted by Amarapu Indrani for a Python programming internship at Slashmark, as part of the requirements for a Bachelor of Technology in Electronics and Communication Engineering. It covers the fundamentals of Python programming, organized into five units, and includes practical projects such as a To-Do List application and a Password Generator. The report aims to provide a solid foundation in Python and encourage further exploration of its libraries and frameworks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views44 pages

Internship Report Format

The document is an internship report submitted by Amarapu Indrani for a Python programming internship at Slashmark, as part of the requirements for a Bachelor of Technology in Electronics and Communication Engineering. It covers the fundamentals of Python programming, organized into five units, and includes practical projects such as a To-Do List application and a Password Generator. The report aims to provide a solid foundation in Python and encourage further exploration of its libraries and frameworks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

An Internship Report

On

PYTHON PROGRAMMING INTERN


Submitted to
Department of Electronics and Communication Engineering
NARAYANA ENGINEERING COLLEGE, GUDUR

in partial fulfillment of the requirement for the award of the Degree of


Bachelor of Technology
In
Electronics and Communication Engineering
by

AMARAPU INDRANI 21F11A0403

Under the esteemed guidance of

Dr.P.SREENIVASULU M.Tech, Ph.D


Professor, Department of ECE

Department of Electronics and Communcation Engineering


NARAYANA ENGINEERING COLLEGE:: GUDUR
(AUTONOMOUS)
Gudur, Andhra Pradesh, India – 524101
2025
NARAYANA ENGINEERING COLLEGE:: GUDUR
(AUTONOMOUS)
Department of Electronics and Communication Engineering

Certificate
This is to certify that the internship entitled “INTERNET of THINGS” being
submitted by AMARAPU INDRANI (21F11A0403) in partial fulfilment of the
requirement for the award of the Degree of Bachelor of Technology in Electronics and
Communication Engineering to the Jawaharlal Nehru Technological University
Anantapur, Ananthapuramu is a bonafide work carried out in Slashmark, under my
guidance and supervision. The results embodied in this internship report have not been
submitted in any university or organization for the award of any degree.

Internship Guide Head of the Department


Dr. P.SREENIVASULU M. Tech, Ph.D Dr. Y. Neeraja M.Tech, Ph.D

Professor Professor

Department of ECE Department of ECE

Narayana Engineering College Narayana Engineering College

Gudur Gudur
Python Programming

ACKNOWLEDGEMENT
I am extremely thankful to Dr. P. Narayana, the Founder Chairman of the
Narayana Group, for his initiative in starting a technical institution in a rural area like
Gudur, helping economically disadvantaged students.

I am also thankful to Mr. K. Puneeth, the Chairman of the Narayana Group, for
providing the infrastructural facilities, without which this work would not have been possible.

I express my sincere gratitude to Dr. B. Dattatraya Sarma, the esteemed Director


of Narayana Professional Colleges, for his invaluable guidance, unwavering support,
and for providing the necessary infrastructural facilities that made this work possible. His
leadership and vision have been a constant source of inspiration.

I would like to express my sense of gratitude to Dr. V. Ravi Prasad, Principal,


Narayana Engineering College, Gudur, for continuous efforts in creating a competitive
environment in our college and for his encouragement throughout this program.

I would like to express my deep sense of gratitude to Dr. K. Vishwaksena Reddy,


Dean, planning and Development, Narayana Engineering College, Gudur, for his
kind encouragement in doing this internship and for helping me complete it successfully.

I would like to convey my heartfelt thanks to Dr. Y. Neeraja, Professor & HOD of
Electronics and Communication Engineering and my sincere thanks to internship coordinator
Mrs. SK. Asma Sulthana, Assistant Professor for giving the opportunity to embark
upon this topic and for his continuous encouragement throughout the internship.

I would like to thank my Internship Guide Dr. P.SREENIVASULU, Professor,


Department of Electronics and Communication Engineering, for his valuable guidance and
the constant assistance, support, endurance, and constructive suggestions for the betterment
of the internship.

I also thank all the Faculty,Non-Teaching Staff, Library Staff of the Department
of Electronics & Communication Engineering for helping me directly or indirectly completing
this internship successfully.

Finally, I am thankful to my parents and friends for their continued moral and material
support throughout the course and for helping me finalize this report.

Dept.ECE NECG 2
DECLARATION

We hereby declare that the Internship entitled “PYTHON PROGRAMMING INTERN” is an

original work submitted by me to the Department of Electronics and Communication

Engineering, NARAYANA ENGINEERING COLLEGE, GUDUR and I have not

submitted the same to any other University or Institute for the award of any Degree.

AMARAPU INDRANI 21F11A0403

Date:

Place: Gudur
ABSTRACT

This report introduces the fundamentals of Python programming, a popular and versatile

programming language. The content is organized into five comprehensive units, each building

on the previous ones to provide a thorough understanding of Python, from basic concepts to

advanced applications. The goal is to equip anyone interested in Python with the skills to

develop simple to complex programs and eventually create web applications using the Django

framework. The first three units form the core of Python programming knowledge that every

user should master. These units cover essential topics such as basic constructs, data types,

control structures, and modular programming with functions and modules. By the end of

these units, one should be able to write simple Python programs confidently.

Building on this foundational knowledge, the fourth unit introduces more complex topics,

including string functions, file handling, and regular expressions. These topics require a deeper

understanding and more practice. The fifth unit focuses on web application development using

the Django framework. This section delves into the configuration and development processes,

guiding through creating a first web application. Although the setup can be complex, the

satisfaction of seeing a functional web application makes the effort worthwhile. Practical

examples and detailed explanations help demystify the complexities of Django.

Overall, this report aims to spark a lasting interest in Python programming by providing a

solid foundation and encouraging further exploration of its libraries and frameworks. Through

carefully crafted examples and illustrations, I have found myself well-equipped to continue my

Python journey.
Python Programming

Contents

1 ABOUT COMPANY 1

1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2 ABOUT INTERNSHIP 3

3 PYTHON COURSEWORK OVERVIEW 4

3.1 Introduction, Variables, and Data Types . . . . . . . . . . . . . . . . . . . . . 4

3.1.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3.1.2 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.1.3 Installation and Execution . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.1.4 Basic Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.2 Control Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.2.1 Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

3.2.2 Loops . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

3.3 Functions, Modules and Packages . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.3.1 Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3.3.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.3.3 Packages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

3.4 Files and Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.4.1 File Handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

Dept.ECE NECG i
Python Programming

3.4.2 Reading and Writing to text files in Python . . . . . . . . . . . . . . . 16

3.4.3 File Access Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.4.4 Python Regular Expressions . . . . . . . . . . . . . . . . . . . . . . . 18

3.5 Django Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.5.1 Installing and Running Django . . . . . . . . . . . . . . . . . . . . . . 19

3.5.2 Creating and Running a Web Application . . . . . . . . . . . . . . . . 20

4 PYTHON PROJECTS OVERVIEW 22

4.1 Project 1: Simple To-Do List Application . . . . . . . . . . . . . . . . . . . . . 22

4.1.1 Description: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4.1.2 Objectives: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4.1.3 Implementation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4.2 Project 2: Number Guessing Game . . . . . . . . . . . . . . . . . . . . . . . . 24

4.2.1 Description: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4.2.2 Objectives: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4.2.3 Implementation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

4.3 Project 3: Python Password Generator . . . . . . . . . . . . . . . . . . . . . . 26

4.3.1 Description: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4.3.2 Objectives: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

4.3.3 Implementation: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

5 INTERNSHIP OUTCOMES 28

6 TECHNICAL SKILLS DEVELOPMENT 29

6.1 Tools and Technologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

6.2 Development Frameworks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

Dept.ECE NECG ii
Python Programming

7 APPLICATION OF SKILLS 31

8 CONCLUSION 32

9 REFERENCES 33

Dept.ECE NECG iii


Python Programming

List of Figures

1.1 Slash Mark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

3.1 Python Logo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

3.2 Python Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

3.3 Python Installation Check . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3.4 Input and Output program . . . . . . . . . . . . . . . . . . . . . . . . . . 8

3.5 Hierarchy Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

3.6 Files Handling in Python . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3.7 Writing to a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.8 Reading from a File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.9 Regular Expressions in Python . . . . . . . . . . . . . . . . . . . . . . . 18

4.1 Simple To-Do List Project . . . . . . . . . . . . . . . . . . . . . . . . . . 23

4.2 Number Guess Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

4.3 Password Generator Project . . . . . . . . . . . . . . . . . . . . . . . . . 27

Dept.ECE NECG iv
Python Programming

Chapter 1

ABOUT COMPANY
Slashmark IT specializes in offering virtual internships across diverse domains such as

machine learning, web development, Python, Java, AI, and data science. These internships are

structured around practical, project-based learning, enabling interns to engage in real-world

projects that span from foundational to advanced levels. Candidates interested in applying

can submit their applications conveniently through either the AICTE portal or directly on

the Slashmark website. Upon selection, interns typically receive an offer letter and login

credentials within a week.Interns are organized into batches and assigned specific projects,

which they are required to complete and submit for evaluation. Successful completion of the

internship program leads to a valuable completion certificate accredited by AICTE.

Figure 1.1: Slash Mark

This internship program is designed to cater to students from various educational

backgrounds, providing them with substantial learning opportunities and practical industry

experience. It aims to enhance participants’ skills and bolster their career prospects through

hands-on involvement in impactful projects. For further information and application details,

interested individuals can visit Slashmark IT’s website.

Dept.ECE NECG 1
Python Programming

1.1 Objectives

The main objectives of the organization are as follows:

• Provide practical learning experiences through virtual internships.

• Bridge the gap between theory and real-world application.

• Help interns earn academic credits and receive a completion certificate.

• Recognize and reward top-performing interns.

• Support students in enhancing their skills and career prospects.

Dept.ECE NECG 2
Python Programming

Chapter 2

ABOUT INTERNSHIP
Introduction

The Python Programming internship provided a structured and immersive learning

experience aimed at equipping participants with comprehensive skills in Python programming.

Python has established itself as a versatile language widely utilized across various domains

including web development, data science, automation, and more. This internship was designed

to explore Python’s fundamental principles and advanced applications, preparing participants

to tackle real-world challenges through hands-on projects and practical exercises.Participants

embarked on a journey that began with mastering the basics of Python syntax, variables,

and data types. The curriculum progressively advanced to cover essential programming

constructs such as control flow mechanisms, functions, and modular programming techniques

using modules and packages.

Additionally, the internship delved into advanced topics including file handling, regular

expressions for text processing, and introduction to frameworks like Django for web

development.Throughout the internship, emphasis was placed on practical application through

project-based learning, encouraging participants to develop and implement Python solutions to

solve complex problems. By the end of the program, participants gained not only proficiency

in Python programming but also insights into best practices, industry standards, and the

collaborative nature of software development.This report aims to provide an overview of

the Python internship experience, highlighting key learnings, projects undertaken, and the

invaluable skills acquired during this immersive journey into Python programming.

Dept.ECE NECG 3
Python Programming

Chapter 3

PYTHON COURSEWORK OVERVIEW

3.1 Introduction, Variables, and Data Types

3.1.1 History

Python, conceived by Guido van Rossum in the late 1980s, was officially released in

February 1991 as Python 0.9.0. Guido’s goal was to create a language that emphasized

readability and simplicity, drawing inspiration from ABC, Modula-3, and other programming

languages. Python’s name was inspired by the British comedy group Monty Python,

highlighting its playful and approachable nature.Python gained traction for its clean syntax

and easy-to-understand code structure, appealing to developers seeking productivity and code

reliability. The language evolved through major releases such as Python 2.0 in 2000, which

introduced features like list comprehensions and garbage collection, and Python 3.0 in 2008,

which focused on improving language consistency and removing redundancies.

Figure 3.1: Python Logo

Throughout its development, Python has been guided by principles of simplicity,

readability, and versatility. Its standard library offers extensive support for various

programming tasks, from web development frameworks like Django and Flask to scientific

computing with libraries such as NumPy and pandas. Python’s ecosystem also includes robust

Dept.ECE NECG 4
Python Programming

support for machine learning and artificial intelligence through TensorFlow, PyTorch, and

scikit-learn.

Today, Python stands as one of the most popular programming languages worldwide,

powering applications across industries from finance and healthcare to education and

entertainment. Its open-source nature and active community contribute to its ongoing

evolution and adaptation to emerging technologies.

3.1.2 Features

Python stands out with its:

1. Clear and Readable Syntax: Python’s syntax is easy to understand and write,

resembling plain English, which makes code maintenance simpler.

2. Dynamic Typing: Variables in Python don’t need explicit declaration, enhancing

flexibility and speeding up development.

3. Comprehensive Standard Library: Offers ready-to-use modules for various tasks

like file handling, networking, and data manipulation, reducing the need for additional

libraries.

4. Support for Multiple Programming Paradigms: Allows developers to choose and

combine different programming styles (procedural, object-oriented, functional), making

it adaptable for various types of projects.

5. Cross-platform and Open Source: Works seamlessly on different platforms

(Windows, macOS, Linux) and is freely available with a vibrant community contributing

to its development.

Dept.ECE NECG 5
Python Programming

6. Large Ecosystem of Libraries and Frameworks: Extensive third-party libraries and

frameworks (e.g., Django, NumPy) expand Python’s capabilities for web development,

data analysis, machine learning, and more.

3.1.3 Installation and Execution

Python, a versatile and widely-used programming language, is easy to install and run on

Windows operating systems. Whether you’re a beginner or an experienced developer, Python’s

simplicity and powerful capabilities make it ideal for various applications, from scripting to

web development and scientific computing.

Installation (Windows)

To begin using Python on Windows, start by downloading the latest Python 3 installer

from python.org. Once downloaded, run the installer (‘python-3.x.x.exe‘) and follow the

setup wizard. It’s essential to select the option “Add Python to PATH” during installation,

which simplifies accessing Python from Command Prompt. This ensures Python is easily

callable from any directory on your system. After completing the installation, verify Python’s

installation by opening Command Prompt and typing ‘python –version‘. This command

should display the installed Python version, confirming a successful setup.

Figure 3.2: Python Software

Dept.ECE NECG 6
Python Programming

Execution (Windows)

After installing Python, you can execute Python scripts and interact with Python in

several ways on Windows. To run a Python script, open Command Prompt, navigate to

the directory containing your script using the ‘cd‘ command, and execute it with ‘python

filename.py‘, replacing ‘filename.py‘ with your script’s name. Additionally, you can enter

interactive mode by simply typing ‘python‘ in Command Prompt. Here, you can directly

enter Python commands, making it easy to test code snippets or experiment with Python

features. For more advanced development features and project management, consider using

integrated development environments (IDEs) such as PyCharm or Visual Studio Code.

Figure 3.3: Python Installation Check

3.1.4 Basic Syntax

Python’s syntax is designed to be simple and readable, making it accessible for beginners

while powerful enough for advanced users. Here are key elements of Python’s basic syntax:

1. Statements and Indentation: Python uses indentation (spaces or tabs) to define code

blocks instead of curly braces used in many other languages. Consistent indentation is

crucial for Python’s readability and structure.

2. Comments: Comments in Python start with the HashTag symbol and are used to

annotate code for readability. Comments are ignored by the Python interpreter and are

useful for explaining code or temporarily disabling code segments.

Dept.ECE NECG 7
Python Programming

3. Print Statement: The ‘print()‘ function is used to output text or variables to the

console. It’s commonly used for debugging and displaying information to users (e.g.,

‘print(”Hello, World!”)‘, ‘print(”The value of x is:”, x)‘).

4. Input and Output: Use input() to prompt for user input, storing the result as a string.

print() outputs data to the console, with formatting options like concatenation (+) or

formatted strings (f-strings).

Figure 3.4: Input and Output program

5. Control Flow: Python supports standard control flow constructs such as ‘if‘, ‘elif‘, and

‘else‘ for conditional execution, and ‘for‘ and ‘while‘ loops for iteration. These constructs

use indentation to define code blocks under each condition or loop.

6. Importing Modules: Python’s functionality can be extended by importing modules.

Modules are Python files that contain useful functions and classes. You can import a

module using ”import module” and access its functions using dot notation.

7. Function Definition: Functions in Python are defined using the ‘def‘ keyword followed

by the function name and parentheses. Parameters can be passed into functions, and

they can return values using the ‘return‘ statement.

3.2 Control Structures

Control structures are essential components of programming languages that manage the

flow of execution based on certain conditions or iterate over sequences of data. In Python,

Dept.ECE NECG 8
Python Programming

control structures include conditional statements and loops, which enable developers to make

decisions and perform repetitive tasks efficiently.

3.2.1 Conditional Statements


Conditional statements in Python are used to make decisions in your code based on certain

conditions. These conditions evaluate to either ‘True‘ or ‘False‘, allowing different blocks of

code to execute accordingly. The primary conditional statements in Python are ‘if‘, ‘elif‘, and

‘else‘.

1. if Statement:The ‘if‘ statement evaluates a condition and executes the block of code

within it if the condition is true.

2. elif Statement:The ‘elif‘ (short for “else if”) statement follows an ‘if‘ statement and

allows for multiple conditions to be checked sequentially. If the preceding ‘if‘ or ‘elif‘

condition is false, the next ‘elif‘ condition is evaluated.

3. else Statement:The ‘else‘ statement provides a default block of code that executes if

none of the preceding ‘if‘ or ‘elif‘ conditions are true.

Dept.ECE NECG 9
Python Programming

4. Nested Conditional Statements: Conditional statements can be nested within each

other, allowing for more complex decision making processes.

5. Conditional Expressions (Ternary Operator): Python also supports conditional

expressions, which are shorthand for ‘if-else‘ statements. They are useful for simple

conditions and assignments.

3.2.2 Loops

Loops in Python are used to execute a block of code repeatedly as long as a specified

condition is met or for each item in a sequence. Python provides two main types of loops:

‘for‘ loops and ‘while‘ loops. Both types of loops allow you to control the flow of your program

and automate repetitive tasks.

1. for Loop : The for loops are used when you have a block of code which you want

to repeat a fixed number of times. The for-loop is always used in combination with

an iterable object, like a list or a range. The Python for statement iterates over the

members of a sequence in order, executing the block each time.

Dept.ECE NECG 10
Python Programming

2. while Loop : The given condition, i.e., conditional expression, is evaluated initially in

the Python while loop. Then, if the conditional expression gives a boolean value True,

the while loop statements are executed. The conditional expression is verified again

when the complete code block is executed. This procedure repeatedly occurs until the

conditional expression returns the boolean value False.

3. Nested Loops : Loops can be nested within each other, allowing for more complex

iteration patterns

3.3 Functions, Modules and Packages

Functions,modules and packages are fundamental concepts in Python programming that

enable code reuse, modularity, and better organization. Understanding these concepts is

essential for writing maintainable and efficient code.

3.3.1 Functions

1. Defining Functions : Functions are defined using the ‘def‘ keyword, followed by the

function name and parentheses which may include parameters.

Dept.ECE NECG 11
Python Programming

Figure 3.5: Hierarchy Diagram

2. Calling Functions : Functions are called by using their name followed by parentheses

and passing any required arguments.

3. Parameters and Arguments : Functions can have parameters, which are variables

listed inside the parentheses in the function definition.Arguments are the actual values

passed to the function when it is called,Functions can have default parameters, which

provide default values if no arguments are passed.

4. Return Statement : The ‘return‘ statement is used to exit a function and return a

value.The no ‘return‘ statement is specified, the function returns ‘None‘ by default.

3.3.2 Modules
Modules are files containing Python code (functions, classes, variables) that can be

imported and used in other Python programs. They help in organizing code into manageable

Dept.ECE NECG 12
Python Programming

sections.

1. Importing Modules: Modules are imported using the ”import” statement.

2. Importing Specific Functions or Variables: You can import specific functions or

variables from a module using the ‘from‘ keyword.

3. Creating and Using Custom Modules: You can create your own modules by saving

Python code in a ‘.py‘ file and then importing it into other scripts.

4. Aliasing Modules: Modules can be aliased using the ‘as‘ keyword to shorten the

module name.

3.3.3 Packages

A package is a way of organizing related modules into a directory hierarchy. A package is

simply a directory that contains a special file and multiple module files.

Dept.ECE NECG 13
Python Programming

1. Creating a Package: To create a package, create a directory and add module files to

it.

2. Importing from a Package: You can import modules from a package using the dot

notation.

3. Importing Specific Elements from a Package: You can also import specific

functions, classes, or variables from modules within a package.

4. Nested Packages: Packages can be nested to create a hierarchical structure of

modules.

Modules, packages, and functions significantly enhance software development by promoting

modularity and reusability. Functions encapsulate specific tasks, making code more organized

and easier to understand. Modules group related functions and variables, creating distinct

namespaces that prevent naming conflicts. Packages further organize modules into a

hierarchical structure, facilitating complex project management. This organization improves

collaboration among developers, simplifies testing and debugging, and ultimately leads to more

maintainable and scalable code.

Dept.ECE NECG 14
Python Programming

3.4 Files and Regular Expressions

Handling files and using regular expressions are crucial skills in Python for managing data

storage and performing advanced text processing.

3.4.1 File Handling

File handling in Python is a powerful and versatile tool that can be used to perform a

wide range of operations. However, it is important to carefully consider the advantages and

disadvantages of file handling when writing Python programs, to ensure that the code is secure,

reliable, and performs well. Python supports file handling and allows users to handle files i.e.,

Figure 3.6: Files Handling in Python

to read and write files, along with many other file handling options, to operate on files. The

concept of file handling has stretched over various other languages, but the implementation is

either complicated or lengthy, like other concepts of Python, this concept here is also easy and

short. Python treats files differently as text or binary and this is important. Each line of code

includes a sequence of characters, and they form a text file. Each line of a file is terminated

with a special character, called the EOL or End of Line characters like comma , or newline

Dept.ECE NECG 15
Python Programming

character. It ends the current line and tells the interpreter a new one has begun. Let’s start

with the reading and writing files.

Advantages of File Handling

• Versatility: File handling in Python allows you to perform a wide range of operations,

such as creating, reading, writing, appending, renaming, and deleting files.

• Flexibility: File handling in Python is highly flexible, as it allows you to work with

different file types (e.g. text files, binary files, CSV files, etc.), and to perform different

operations on files (e.g. read, write, append, etc.).

• User–friendly: Python provides a user-friendly interface for file handling, making it

easy to create, read, and manipulate files.

• Cross-platform: Python file-handling functions work across different platforms (e.g.

Windows, Mac, Linux), allowing for seamless integration and compatibility.

3.4.2 Reading and Writing to text files in Python

Python provides built-in functions for creating, writing, and reading files. Two types of

files can be handled in Python, normal text files and binary files (written in binary language,

0s, and 1s).

• Text files: In this type of file, Each line of text is terminated with a special character

called EOL (End of Line), which is the new line character in Python by default.

• Binary files: In this type of file, there is no terminator for a line, and the data is stored

after converting it into machine-understandable binary language.

Dept.ECE NECG 16
Python Programming

3.4.3 File Access Modes

Access modes govern the type of operations possible in the opened file. It refers to how

the file will be used once its opened. These modes also define the location of the File Handle

in the file. The file handle is like a cursor, which defines from where the data has to be read

or written in the file and we can get Python output in text file. There are 6 access modes in

Python:

Writing to a File

To write to a file in Python, you need to open the file in write mode. This can be done

using the built-in open function with the mode ’w’. Once the file is open, you can write text

to it using the write method. After writing, it is essential to close the file to ensure that all

data is properly saved. Using the with statement automatically handles closing the file for

you, even if an error occurs.

Figure 3.7: Writing to a File

Reading from a File

Reading from a file involves opening the file in read mode using the mode ’r’. After opening

the file, you can use the read method to read the entire content of the file into a string. Again,

the with statement ensures that the file is closed automatically after the reading operation is

complete.

Dept.ECE NECG 17
Python Programming

Figure 3.8: Reading a File

3.4.4 Python Regular Expressions

Regular expressions are a powerful language for matching text patterns. This page gives

a basic introduction to regular expressions themselves sufficient for our Python exercises and

shows how regular expressions work in Python. The Python ”re” module provides regular

expression support.

In Python a regular expression search is typically written as: match = re.search(pat,

str) Regular expressions match text patterns. This introduction covers the basics needed for

Python exercises and demonstrates how regular expressions work in Python. The ”re” module

in Python provides support for regular expressions.

In Python, a regular expression search is typically written as:

Figure 3.9: Regular Expressions in Python

The code match = re.search(pat, str) stores the search result in ”match”. The if-statement

checks if the search succeeded. If true, match.group() contains the matching text (e.g.,

’word:cat’). If false (None), the search failed, and there’s no matching text.

Dept.ECE NECG 18
Python Programming

3.5 Django Framework

Django is a high-level Python web framework that emphasizes rapid development and

a clean, pragmatic design. With its comprehensive set of tools and features, Django takes

care of much of the boilerplate involved in web development. This allows developers to focus

on building their applications rather than dealing with repetitive tasks. From setting up a

project to creating and configuring modular applications, Django simplifies each step, making

it accessible to both beginners and experienced developers.

The framework’s powerful URL routing, built-in view handling, and dynamic content

management capabilities make it an ideal choice for scalable and maintainable web

applications. Its ability to handle complex web development tasks with ease and its

commitment to best practices in security and performance are what set Django apart.

3.5.1 Installing and Running Django

To begin developing with Django, you need to install it and set up a new project.

1. Installing Django:

– Open your terminal or command prompt.

– Install Django using the pip package manager with the following command:

pip install django

2. Creating a Django Project: Once Django is installed, create a new project:

– Navigate to the directory where you want to set up your project

– Run the following command to start a new project named ’myproject’:

django-admin startproject myproject

This creates a directory named myproject with the basic structure of a Django

project.

Dept.ECE NECG 19
Python Programming

3. Running the Development Server:

– Navigate into your project directory:

cd myproject

– Start the development server:

python manage.py runserver

– Open your web browser. You should see the default Django welcome page.

3.5.2 Creating and Running a Web Application

1. Creating an Application: Inside your project directory, create a new application

– Run the following command to create an app named ’myapp’

python manage.py startapp myapp

2. Configuring the Application: To make Django recognize your new app, add it to

the project’s settings:

– Open the settings.py file in the myproject directory.

– Add myapp to the INSTALLED APPS list:

INSTALLED APPS = [’myapp’]

This creates a directory named myproject with the basic structure of a Django

project.

3. Create a View: A view in Django handles web requests and returns responses.

– Open views.py in the myapp directory.

– Define a simple view function to return a response:

Dept.ECE NECG 20
Python Programming

4. Mapping URL: A view in Django handles web requests and returns responses.

– Create a urls.py file in the myapp directory (if it doesn’t exist, create it) and add:

5. Running the Application:

– Start the development server (if it’s not already running):

python manage.py runserver

– Open your web browser. You should see the ”Hello, World!” message.

Dept.ECE NECG 21
Python Programming

Chapter 4

PYTHON PROJECTS OVERVIEW


4.1 Project 1: Simple To-Do List Application

4.1.1 Description:

The Simple To-Do List Application is a fundamental Python project designed to introduce

basic programming concepts. This application allows users to manage a list of tasks by adding

new tasks, marking them as completed, and removing them. It demonstrates essential Python

functionalities such as handling user input, manipulating lists, and implementing control flow

through loops and conditionals.

4.1.2 Objectives:
• To understand and implement core Python syntax and functions.

• To develop a basic, interactive command-line tool for task management.

• To practice using lists, loops, and conditionals effectively in a program.

• To gain experience with simple data manipulation and user interface design.

4.1.3 Implementation:

The implementation of the Simple To-Do List Application in Python involves creating a

command-line interface that allows users to manage their tasks through a menu-driven system.

The application consists of several functions: add-task to add new tasks to a list, complete-task

to mark tasks as completed and remove them from the list, remove-task to delete tasks, and

list-tasks to display all current tasks. The main loop continuously displays a menu to the

user and processes their input to call the appropriate function. This approach ensures the

program remains responsive and interactive, allowing users to manage their tasks efficiently.

Dept.ECE NECG 22
Python Programming

The use of basic Python constructs such as lists, loops, conditionals, and functions makes this

application a solid introductory project for learning fundamental programming concepts.

Figure 4.1: Simple To-Do List Project

The Simple To-Do List Application project effectively introduced fundamental

programming concepts and practices using Python. Through this project, I gained a deeper

understanding of Python’s syntax, list manipulation, and basic input/output operations. This

project also reinforced the importance of clear code structure and user-friendly interfaces, even

in simple applications. Completing this project was a crucial step in building the foundation

for more complex Python projects and enhancing my overall programming skills.

Dept.ECE NECG 23
Python Programming

4.2 Project 2: Number Guessing Game

4.2.1 Description:

The Number Guessing Game is an engaging and interactive Python project designed to

provide a fun way to practice programming concepts. In this game, the computer randomly

selects a number within a specified range, and the player tries to guess the number. After

each guess, the computer provides hints indicating whether the guessed number is too high,

too low, or correct. This project helps reinforce the use of loops, conditionals, and random

number generation in Python.

4.2.2 Objectives:
• To learn how to use Python’s random module for generating random numbers.

• To implement a loop that continually processes user input until a condition is met.

• To apply conditional statements for providing feedback to the player.

• To apply conditional statements for providing feedback to the player.

4.2.3 Implementation:

The Number Guessing Game project in Python is designed to offer both entertainment

and educational value. By leveraging Python’s random module, the game generates a random

number within a user-specified range. Players then attempt to guess this number through

a series of interactions where each guess prompts feedback from the program—indicating

whether the guess is too high, too low, or correct. This interactive approach not only

reinforces fundamental programming concepts such as loops, conditionals, and user input

handling but also enhances the player’s engagement through immediate and informative

responses.Implementing this game involves setting up initial parameters, such as defining the

range for the random number, and then entering a loop that continues until the correct number

Dept.ECE NECG 24
Python Programming

is guessed. Through this project, beginners can grasp essential programming structures while

enjoying a dynamic and interactive learning experience.

Figure 4.2: Number Guess Project

The Number Guessing Game is a simple yet effective project that showcases the use

of loops, conditionals, and random number generation in Python. It offers an enjoyable

and educational experience, reinforcing core programming skills in a playful context. This

project not only demonstrates how to create an interactive application but also highlights the

importance of user feedback and input validation in game design. Through this project, I

enhanced my understanding of user interaction and control flow in Python, which are crucial

skills for more advanced programming tasks.

Dept.ECE NECG 25
Python Programming

4.3 Project 3: Python Password Generator

4.3.1 Description:

The Python Password Generator project aims to provide a robust solution for creating

secure passwords suitable for various online accounts. Password security is increasingly critical

in today’s digital landscape, where cybersecurity threats are prevalent. This project addresses

this concern by leveraging Python’s capabilities to generate passwords that are random,

complex, and difficult to crack. Users can customize the generated passwords based on length

and character types (uppercase letters, lowercase letters, digits, symbols), ensuring flexibility

and adherence to best practices in password security.

4.3.2 Objectives:
• Generate random and secure passwords using Python.

• Allow customization of password length and character types (uppercase, lowercase,

digits, symbols).

• Enhance understanding of Python’s random module and string manipulation.

• Enhance understanding of Python’s random module and string manipulation.

4.3.3 Implementation:

The Python Password Generator project is implemented using Python’s capabilities to

ensure robust password generation and user interaction. The core of the implementation

revolves around the ‘generate password‘ function, which is responsible for creating passwords

based on user-specified criteria. This function utilizes Python’s ‘random‘ module to generate

random characters from predefined sets—uppercase letters, lowercase letters, digits, and

symbols—depending on the user’s preferences. By iterating through the specified length,

Dept.ECE NECG 26
Python Programming

the function constructs a password string that combines these characters in a random order,

ensuring each generated password is unique and secure.

The implementation begins with a welcoming message and prompts the user to input

parameters such as the desired password length and whether to include uppercase letters,

lowercase letters, digits, and symbols. Each input is validated to ensure the user’s preferences

are correctly interpreted. Once the ‘generate password‘ function creates the password

string based on these inputs, it is displayed to the user. Optionally, the program provides

functionality to copy the generated password to the clipboard using the ‘pyperclip‘ module,

enhancing user convenience for immediate use.

Figure 4.3: Password Generator Project

This project not only reinforces essential Python programming skills such as string

manipulation, conditional statements, and module usage but also emphasizes the importance

of cybersecurity practices in creating strong passwords. It provides a practical tool for users

to enhance their online security by generating passwords that are both random and complex,

thereby contributing to safer digital interactions and reinforcing fundamental concepts of

software development in Python.

Dept.ECE NECG 27
Python Programming

Chapter 5

INTERNSHIP OUTCOMES

The Python programming internship significantly enhanced my technical skills and

practical understanding of Python. Through structured units covering fundamental concepts,

control structures, functions, modules, file handling, regular expressions, and web development

with Django, I gained a deep comprehension of Python’s core capabilities. Engaging

in project-based learning through tasks like the Simple To-Do List Application, Python

Password Generator, and Number Guessing Game allowed me to apply theoretical knowledge

to real-world scenarios. These projects reinforced my coding practices and demonstrated

Python’s versatility in creating practical applications.

The internship also fostered strong problem-solving skills and creativity. Tackling diverse

programming challenges helped me develop the ability to analyze problems, devise efficient

solutions, and implement them effectively. The introduction to the Django framework

broadened my understanding of web technologies, equipping me to develop scalable and

interactive web applications. Each project required strategic thinking to break down tasks

and optimize code, which greatly enhanced my problem-solving abilities.

Overall, the internship was a transformative experience, providing a well-rounded blend of

theoretical knowledge and hands-on practice. The practical projects and interactive learning

environment helped solidify my understanding of Python and its applications. This experience

has prepared me for future endeavors in software development, instilling confidence and

proficiency in tackling complex programming challenges and developing innovative solutions.

Dept.ECE NECG 28
Python Programming

Chapter 6

TECHNICAL SKILLS DEVELOPMENT


During the Python internship, a significant focus was placed on developing technical

skills that are essential for proficient programming and software development. This section

highlights the key areas where skills were honed and expanded.One of the primary outcomes

of the internship was the enhancement of programming skills in Python. This included:

• Syntax and Semantics: Gaining a deep understanding of Python syntax and

semantics, which is crucial for writing clean and efficient code.

• Problem-Solving: Developing problem-solving abilities by tackling various

programming challenges and projects, enabling a practical understanding of algorithmic

thinking.

• Code Optimization: Learning techniques to optimize code for better performance

and efficiency, an essential skill for professional software development.

6.1 Tools and Technologies

The internship provided exposure to a variety of tools and technologies that are widely

used in the industry:

• Integrated Development Environments (IDEs): Familiarization with popular

Python IDEs such as PyCharm and VSCode, which streamline the coding process and

enhance productivity.

• Version Control Systems: Understanding the importance of version control

and gaining hands-on experience with Git, enabling efficient collaboration and code

management.

Dept.ECE NECG 29
Python Programming

• Libraries and Frameworks: Learning to utilize Python libraries such as NumPy,

Pandas, and Matplotlib for data analysis and visualization, as well as frameworks like

Django for web development.

6.2 Development Frameworks

An important aspect of the internship was the introduction to development frameworks

that aid in building robust applications:

• Django Framework: Gaining expertise in Django, a high-level Python web framework

that encourages rapid development and clean, pragmatic design. This included learning

about its features, setup, and how to build web applications.

• Regular Expressions: Mastering the use of regular expressions for pattern matching

and text processing, a powerful tool for data manipulation and validation.

• File Handling: Developing skills in file handling, including reading from and writing

to files, which is essential for data processing and storage in applications.

Dept.ECE NECG 30
Python Programming

Chapter 7

APPLICATION OF SKILLS
The skills acquired during the Python internship have versatile applications across

academic, professional, and personal contexts:

1. Academic Projects: Implementing Python programming skills enhances efficiency and

effectiveness in completing coursework and research projects. Python’s capabilities in

data analysis and visualization support data-driven research and academic exploration.

2. Career Paths: Proficiency in Python opens doors to various career paths:

– Software Development: Skills in Python programming and frameworks like Django

enable building scalable applications for diverse industries.

– Data Science: Using Python libraries such as Pandas for data manipulation and

analysis prepares for roles in data science and analytics.

– Web Development: Experience with Django facilitates development of dynamic web

applications, crucial for frontend and backend development roles.

2. Continued Education: Pursuing advanced Python courses and certifications

deepens technical expertise and keeps abreast of industry trends. Engaging in personal

projects allows for experimentation with new technologies, fostering innovation and

problem-solving skills.

2. Community Engagement: Active participation in programming communities,

workshops, and open-source projects enhances learning, expands professional networks,

and provides opportunities for collaboration and knowledge sharing.

Dept.ECE NECG 31
Python Programming

Chapter 8

CONCLUSION

Throughout the Python internship, I have embarked on a transformative learning journey

that has significantly enhanced my skills and understanding of programming fundamentals.

Beginning with foundational concepts and progressing to advanced topics such as web

development with Django and data manipulation with Pandas, each module and project has

deepened my proficiency in Python. The hands-on experience gained from projects like the

Simple To-Do List Application, Python Password Generator, and Number Guessing Game has

been invaluable, allowing me to apply theoretical knowledge to real-world scenarios effectively.

Moreover, the internship has not only sharpened my technical abilities but also fostered

essential soft skills such as problem-solving, teamwork, and effective communication through

collaborative projects and mentor interactions. Engaging with industry standards and best

practices has provided a comprehensive understanding of professional expectations in the

tech industry. This experience has instilled confidence in pursuing advanced studies and

certifications while remaining adaptable to emerging technologies and career opportunities.

Overall, the Python internship has laid a robust foundation for my future career in software

development, data analysis, and beyond, equipping me with the skills, knowledge, and

determination to succeed in the dynamic field of programming.

Dept.ECE NECG 32
Python Programming

Chapter 9

REFERENCES

1. Python Tutorial by Guido van Rossum and Python development team.

https://www.scribd.com/document/472939303/python-3-7

2. A Practical Introduction to Python Programming by Brian Heinold.

https://www.brianheinold.net/python/python_book.html

3. Python Tutorial on w3schools.

https://www.w3schools.com/python/default.asp

4. Geeks For Geeks Python Programming Examples.

https://www.geeksforgeeks.org/python-programming-examples/

5. Course Webpage by Rupesh Nasre, IIT Madras.

http://www.cse.iitm.ac.in/~rupesh/books/python/

Dept.ECE NECG 33
Internship Diary - Weekly Report on IoT
Name of the Student: Amarapu Indrani Roll No: 21F11A0403
Name of the Industry/Organization: Slash Mark
Name of the Track: IoT (Internet of Things)

Week No Date Weekly Learning Outcome

1 01-01-2024 to 07-01-2024 Introduction to IoT, history, applications, and impor-


tance in modern technology.

2 08-01-2024 to 14-01-2024 Understanding IoT architecture, components, and net-


work layers.

3 15-01-2024 to 21-01-2024 Introduction to microcontrollers used in IoT (Arduino,


ESP8266, Raspberry Pi).

4 22-01-2024 to 28-01-2024 Sensor interfacing: Temperature, humidity, motion, and


light sensors.

5 29-01-2024 to 04-02-2024 IoT communication protocols: MQTT, CoAP, HTTP,


WebSockets.

6 05-02-2024 to 11-02-2024 Cloud platforms in IoT: AWS IoT, Google Firebase,


IBM Watson.

7 12-02-2024 to 18-02-2024 IoT data storage and analytics: Collecting and process-
ing sensor data.

8 19-02-2024 to 25-02-2024 Real-time IoT applications: Smart agriculture, home


automation, and healthcare.

9 26-02-2024 to 03-03-2024 IoT security fundamentals: Threats and vulnerabilities


in IoT devices.

10 04-03-2024 to 10-03-2024 Encryption techniques and secure communication in


IoT.

11 11-03-2024 to 17-03-2024 Introduction to blockchain for IoT security.

1
Week No Date Weekly Learning Outcome

12 18-03-2024 to 24-03-2024 IoT system integration and case study on Industrial IoT
(IIoT).

13 25-03-2024 to 31-03-2024 Edge computing in IoT: Processing data closer to the


source.

14 01-04-2024 to 07-04-2024 AI in IoT: Implementing machine learning for smart IoT


applications.

15 08-04-2024 to 14-04-2024 Final project: Smart home automation using IoT de-
vices.

16 15-04-2024 to 21-04-2024 Internship conclusion: Documentation and final presen-


tation of the project.

Internship Guide HoD ECE

You might also like