Skilldzire Python Document
Skilldzire Python Document
SKILL DZIRE
FULL STACK PYTHON
A Internship Report Submitted at the end of eight semester
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING
(INTERNET OF THINGS)
Submitted By
PERUMALLA HARINI
(21981a4943)
1
lOMoAR cPSD| 45929297
2024-2025
CERTIFICATE
This is to certify that this project entitled “Full Stack Python” done by
“PERUMALLA HARINI (21981A4943)” is a student of B.Tech in the Department of
Computer Science and Engineering, Raghu Engineering College, during the period 2021-
2025, in partial fulfillment for the award of the Degree of Bachelor of Technology in
Computer Science and Engineering to the Jawaharlal Nehru Technological University,
Gurajada Vizianagaram is a record of bonafide work carried out under my guidance and
supervision.
The results embodied in this internship report have not been submitted to any other
University or Institute for the award of any Degree.
Visakhapatnam. Visakhapatnam.
EXTERNAL EXAMINER
2
lOMoAR cPSD| 45929297
SkillDzire
BY
PERUMALLA HARINI (21981A4943)
PROJECT GUIDE
Designation
Internal Examiner
External Examiner
HOD
Date:
3
lOMoAR cPSD| 45929297
DECLARATION
This is to certify that this internship titled “Full Stack Python” is bonafied work done by
my me, impartial fulfillment of the requirements for the award of the degree B.Tech
andsubmitted to the Department of Computer Science and Engineering(IOT), Raghu
Engineering College, Dakamarri.
I also declare that this internship is a result of my own effort and that has not been
copied from anyone and I have taken only citations from the sources which are
mentioned in the references.
This work was not submitted earlier at any other University or Institute for the
reward of any degree.
Date:
Place:
PERUMALLA HARINI
(21981A4943)
4
lOMoAR cPSD| 45929297
CERTIFICATE
5
lOMoAR cPSD| 45929297
ACKNOWLEDGEMENT
Regards
PERUMALLA HARINI
(21981a4943)
.
6
lOMoAR cPSD| 45929297
TABLE OF CONTENTS
CONTENTS PAGE NO.
1.1 Introduction 9
1.2 History 9
1.3 Features 9
1.4 Applications 10-11
1.5 Installation of Python 11-12
4. Functions 31-38
7
lOMoAR cPSD| 45929297
7. CONCLUSION 45
8
lOMoAR cPSD| 45929297
1. INTRODUCTION TO PYTHON
1.1 INTRODUCTION
Python is a simple, general purpose, high level, and object-oriented programming
language.
Python is a interpreted scripting language.
Python is a trending programming language to develop various applications.
As of 2022, Python continues to be one of the most popular programming languages
worldwide, used extensively in Web development, data science, machine learning,
artificial intelligence, science computing, automation, and more.
The Python Software Foundation (PSF) oversees Python’s development and promotes its
adoption and growth.
1.2 HISTORY
Invented in Netherlands early by Guido Van Rossum.
Python was conceived in late 1980’s and its implementation was started in December
1989.
Guido van Rossum is fan of ‘Monty Python Firing Circus,’ this is a famous TV show in
Netherlands.
Maned after Monty Python.
Open sourced in the year 2012.
Its vibrant community and thriving ecosystem ensure that Python remains relevant and
continues to evolve to meet the needs of developers and industries alike.
1.3 FEATURES
Easy-to-learn – Python has few keywords, simple structures, and a clearly defined
syntax. This allows the student to pick up the language quickly.
Easy-to-read – Python code is more clearly defined and visible to eyes.
Easy-to-maintain – Python’s source code is fairly easy-to-maintain.
A broad standard library – Python’s bulk pf the library is very portable and
crossplatform compatible on UNIX, Windows, and Macintosh.
Interactive Mode – Python has support for an interactive mode which allows interactive
testing and debugging of snippets of code.
9
lOMoAR cPSD| 45929297
Portable – Python can run on a widely variety of hardware platforms and has the same
interface on all platforms.
Extendable – It can add low-level modules to the Python interpreter. These modules
enable programmers to add to or customize their tools to be more efficient.
Databases – Python provides interfaces to all major commercial databases.
GUI Programming – Python supports GUI applications that can be created and ported
to many system calls, libraries, and windows systems, such as Windows MFC, Macintosh,
and the X Window system of Unix.
Scalable – Python provides a better structure and support for large programs than shell
scripting.
1.4 APPLICATIONS
Web Development
• Django – A high-level Python web framework that enables rapid development and
clean, pragmatic design.
• Flask – A lightweight web framework that provides the essentials for building web
applications without the complexity of a full-stack framework.
• Pyramids – A flexible and minimalist web framework for building small to largescale
web applications.
Data Science and Analytics
• NumPy – A library for numerical computing that provides support for large,
multidimensional arrays and matrices.
• Pandas – A library for data manipulation and analysis, offering data structures and
functions to efficiently work with structured data.
• Matplotlib – A plotting library for creating ststic, interactive, and animated
visualizations in Python.
• Scikit-learn – A machine learning library that provides simple and efficient tools for
data mining and analysis.
10
lOMoAR cPSD| 45929297
11
lOMoAR cPSD| 45929297
Start Using: Access Python via command line with ‘python,’ or create and run Python
scripts.
The hardware and software requirement for Python development and execution are
relatively minimal, making it accessible across a wide range of devices and platforms.
HARDWARE REQUIREMENT
12
lOMoAR cPSD| 45929297
• The amount of RAM required depends on the complexity of Python applications and
the size of datasheets that working with. For basics development and execution, even
system with few gigabytes of RAM should suffice.
STORAGE SPACE
• Python’s core installation does not require much disk space. However, the disk space
needed may vary depending on the size of the project and the dependencies/libraries
that install. A few gigabytes of storage space should be more than enough for most
Python projects.
(a) (b)
(c)
Fig 2. Hardware Requirements of Python (a) i3 processor (b) RAM (c) Storage.
SOFTWARE REQUIREMENT
Operating System
• Python is compatible with various operating systems, including Windows, Macintosh,
Linux distributions (e.g., Ubuntu, Debian, CentOS).
• Python code written on one operating system can typically run on other without
modification, thanks to Python’s cross-platform compatibility.
Python Interpreter
You need a Python interpreter to run Python code. You can download and install the
official Python interpreter from the Python Software Foundation's website: Python
Downloads.
Integrated Development Environment (IDE)
While not strictly required, using an IDE or text editor can greatly enhance your
13
lOMoAR cPSD| 45929297
Python's minimal hardware and software requirements contribute to its popularity and
accessibility, allowing developers to write and run Python code on a wide range of devices and
platforms with ease.
14
lOMoAR cPSD| 45929297
1) Compilation
2) Interpreter
15
lOMoAR cPSD| 45929297
2. KEY CONCEPTS
1) Numbers 2)
Strings
NUMBERS
STRINGS
16
lOMoAR cPSD| 45929297
ESCAPE SEQUENCES
17
lOMoAR cPSD| 45929297
Type () – This function is used to determine the type of an object as in Figure 6. It returns the
type of the object as a class object.
18
lOMoAR cPSD| 45929297
III. BOOLEAN
The Boolean data type is either True or False.
In Python, Boolean variables are defined by the True and False keywords.
IV. COLLECTIONS
Collections refers to data structures that are used to store and manage collections of data. These
collections provide various functions and are designed to suit different needs. Collections in
python are basically container data types, namely lists, sets, tuples, dictionary.
Here an introduction to collections in Python along with some commonly used types:
LISTS
TUPLES
19
lOMoAR cPSD| 45929297
Tuples are similar to lists but are immutable, meaning their content cannot be changed after
creation.
Tuples are created using parentheses ‘()’.
Example: ‘my_tuples = (1, 2, 3, 4, 5, 6)’
SETS
DICTIONARIES
2.4 OPERATIONS
In Python, operators are special symbols or keywords that are used to perform
operations on operands. Here is an overview of the different types of operators in Python:
ARITHMETIC OPERATORS
Addition: ‘+’
Subtraction: ‘-’
Multiplication: ‘*’
Division: ‘/’
Floor Division: ‘//’ (returns the integer part of the division)
Modulus: ‘%’ (returns the remainder of the division)
Exponentiation: ‘**’ (raises the left operand to the power of the right operand)
20
lOMoAR cPSD| 45929297
COMPARISON OPERATIONS
Comparison operators are used to compare the values of two operands as shown in Figure 8.
Equal to: ‘==’
Not equal to: ‘! =’
Greater than: ‘>’
Less than: ‘<’
Greater than or equal to: ‘>=’
Less than or equal to: ‘<=’
LOGICAL OPERATORS
Logical operators are used to combine conditional statements as in Figure 10.
Logical AND – ‘and’
Logical OR – ‘or’
Logical NOT – ‘not’
21
lOMoAR cPSD| 45929297
ASSIGNMENT OPERATORS
Assignment operators are used to assign values to variables as in Figure 11.
Assignment: ‘=’
Addition assignment: ‘+=’
Subtraction assignment: ‘ -=’
Multiplication assignment: ‘*=’
Division assignment: ‘/=’
Modulus assignment: ‘%=’
Floor division assignment: ‘//=’
Exponentiation assignment: ‘**=’
22
lOMoAR cPSD| 45929297
Type casting and type coercion are both mechanisms used in programming language to
convert data from one type to another, but they differ in their approaches and implications.
• Explicit conversion of a value from one datatype to another is called type casting.
• Implicit conversion of datatypes during compilation or runtime is called Type Coercion.
TYPE CONVERSION
Type conversion, also known as type casting, is the process of converting a value from one
data type to another. In Python, it can perform type conversion using built-in functions or
constructors. Here are some common type conversion functions:
23
lOMoAR cPSD| 45929297
3. CONTROL STATEMENTS
In Python, control statements are used to control the flow of execution in a program based on
certain conditions. They allow to make decisions, execute code repeatedly, and handle
exceptions. Three fundamental methods of control flow:
1) Sequential
2) Selection (execution only a selected set of stmts)
3) Iteration (execute a set of statements repeatedly)
• These statements usually jump from one part of code to another depending on whether a
particular condition is satisfied or not.
• Conditional statements execute sequentially when there is no condition around the
statements.
• If you put some condition for a block of statements, the execution flow may change based
on the result evaluated by the condition.
24
lOMoAR cPSD| 45929297
SAMPLE PROGRAM
If you input a positive number like 5, the program will increment it by 1, resulting in 6 as the
output. If you input a number that is not positive, such as 0 or a negative number, the program
will not increment it, and the output will be the same as the input number.
Nested if: Nested if statements mean an if statement inside another is statement. The flow chart
for if statement is shown in Figure 14.
SAMPLE PROGRAM
25
lOMoAR cPSD| 45929297
If the input the year 2024, the program will determine that it is a leap year and print "2024 is a
leap year".
If-else: The if-else statement evaluates test expression and will execute the body of if only
when the test condition is True. If the condition is False, the body of else is executed.
Indentation is used to separate the blocks.
ITERATIVE STATEMENTS
WHILE LOOP
In the while loop, test expression is checked first. The body of the loop is entered only if
the test expression evaluates to True. After one iteration, the test expression is checked
again. This process continues until the test expression evaluates to False. The flow chart of
while loop is in the figure 15.
26
lOMoAR cPSD| 45929297
The break statements terminate the loop containing it. Control of the program flow to the
statements immediately after the body of the loop. If the break statements is inside a nested
loop (loop inside another loop), the break statement will terminate the innermost loop.
27
lOMoAR cPSD| 45929297
In this example, the while loop continues as long as num is less than 5. Inside the loop, num is
printed, and then it is checked whether num is equal to 3. If the condition is true, the break
statement is executed, and the loop terminates
The continue statement is used to skip the rest of the code inside a loop for the current iteration
only. Loop does not terminate but continues on with the next iteration.
In this example, the while loop continues as long as Num is less than 5. Inside the loop,
Num is incremented by 1. Then, it is checked whether Num is equal to 2. If the condition is
true, the continue statement is executed, and the loop skips the remaining code block for
that iteration. Otherwise, the value of Num is printed.
FOR LOOP
For loop is usually known as determinate or definite loop because the programmer knows
exactly how many times the loop will repeat. The number of times loop has to be executed
can be determined mathematically checking logic of the loop. The flow chart of for loop is
shown in figure 16.
Syntax
For loop_control_var in sequence:
Statement 1
Statement 2
28
lOMoAR cPSD| 45929297
SAMPLE PROGRAM
Program using for loop to check whether the number is even or odd
Each number from 1 to 10 is printed along with whether it is odd or even. Odd numbers have
a remainder of 1 when divided by 2, while even numbers have a remainder of 0.
29
lOMoAR cPSD| 45929297
NESTED LOOPS
Nested loops in Python refer to using one or more loops inside another loop. This allows you
to iterate over a sequence of elements or perform a certain operation multiple times, with one
loop contained within another loop.
inner_loop_variable in inner_sequence:
Nested loops are commonly used when dealing with multi-dimensional data structures, such as
lists of lists or matrices, or when you need to perform a repetitive task that involves multiple
levels of iteration.
In this example, the outer loop (for i in range (5)) iterates over the rows, and the inner loop
which (for j in range (i + 1)) iterates over the columns for each row. This results in a pattern
where the number of asterisks increases with each row.
30
lOMoAR cPSD| 45929297
4. FUNCTIONS
INTRODUCTION
A function is a block of organised and reusable program code that performs a simple,
specific, and well-defined task.
Func (1) is called to perform a well-defined task. As soon as Func (1) is called, the program
control is passed to first statement in function. All the statements in function are executed
and program control is passed to function following the one that called the function.
Func (1) calls function named Func (2). Therefore Func (1) is known as calling function.
Func (2) is known as function.
31
lOMoAR cPSD| 45929297
FUNCTION DEFINITION
• Function blocks begin with the keyword def followed by the function name and
parentheses().
• Any input parameters or arguments should be placed within these parentheses().
• The first statement of a function can be an optional statement – the documentation string
of the function or docstring.
32
lOMoAR cPSD| 45929297
FUNCTION CALL
33
lOMoAR cPSD| 45929297
INTRODUCTION
File is a collection of data stored on a secondary storage device like hard disk.
If working in a large software application where they process many data, then it cannot
expect those data to be stored in a variable as the variables are volatile in nature.
Hence when it handles such situations, the role of files will come into the picture.
As files are non-volatile in nature, the data will be stored permanently in a second device
like Hard Disk and using python it can handle the files in applications.
TYPES OF FILES
1) Binary file
2) Text file
BINARY FILE
Most of the files that visible in personal computer system are called binary files.
All binary files follow a specific format. It can open some binary files in the normal text
editor but it cannot read the content present inside the file. That is because all the binary files
will be encoded in the binary format, which can be understood only by a computer or
machine.
For handling such binary files it can need a specific type of software to open it.
For Example – it needs Microsoft word software to open .doc binary files. Likewise, it need
a .pdf reader software to open .pdf binary files and it need a photo editor software to read the
image files and so on.
34
lOMoAR cPSD| 45929297
TEXT FILE
Text files do not have any specific encoding and it can be opened in normal text editor itself.
Most importantly there are four types of operations that handled by Python on files:
OPENING A FILE
SYNTAX
File_object = open(file_name,mode)
File_name is the name of the file or the location of the file that want to open.
MODE
• The file in the open function syntax will tell Python as what operation that what to do on a
file.
• ‘r’ – Read Mode : Read mode is used only to read data from the file.
• ‘w’ – Write Mode : This mode is used when it want to write data into a file or modify it.
Remember write mode overwrites the data present in the file.
• ‘s’ – Append Mode : Append mode is used to append data to the file. Remember data will
be appended at the end of the file pointer.
• ‘r+’ – Read or Write Mode : This mode is used when it want to write or read the data
from the same file.
• ‘w+’ – Read or Write Mode : When a file is opened in this mode. If the file has not been
created new file will be created if created it is overwritten.
35
lOMoAR cPSD| 45929297
• ‘a+’ – Append or Read Mode : This mode is used when it want to read data from the file
or append the data into the same file.
BINARY MODE
• ‘wb’ – Open a file for write only mode in the binary format.
• ‘rb’ – Open a file for the read -only mode in the binary format.
• ‘ab’ – Open a file for appending only mode in the binary format.
• ‘rb+’- Open a file for read and write only mode in the binary format.
• ‘ab’ - Open a file for appending and read only mode in the binary format.
READ A FILE
There are three ways in which we can read the files in python
Read([n])
Readline([n])
Readlines()
lineno=int(input(“enter a number”))
print(line)
break
In order to close a file, we must first open a file. In python, we have an in built method
called close() to close the file which is opened.
Whenever you open a file, it is important to close it, especially, with write method. Because
if we don’t call the close function after the write method then whatever data we have written
to a file will not be saved in to the file.
Example
36
lOMoAR cPSD| 45929297
Print(my_file.read())
My_file.close()
WRITE A FILE:
In order to write data into a file, we must open the file in the write mode.
We need to be very careful while writing data in to the file as it overwrites the content
present inside the file that you were writing, and all previous data will be erased.
We have two methods for writing data into a file as shown below.
Write(string)
Writelines(list) Write() my_file=open(“C:/Documents/Python/test.txt”, “w”)
Writelines()
My_file=open(“C:/Documents/Python/test.txt”, “a+”)
My_file.write(“Strawberry”)
The above code appends the string ‘strawberry’ at the end of the ‘test.txt’file.
My_file=open(“C:/Documents/Python/test.txt”, “w”)
My_file. Writelines(fruits)
37
lOMoAR cPSD| 45929297
KEY ASPECTS
Data Querying: SQL allows users to retrieve data from databases using queries. Queries
can range from simple requests for specific records to complex operations involving
multiple tables and conditions.
Data Manipulation: SQL provides commands for inserting, updating, and deleting data
within a database. This allows users to modify existing records or add new ones as needed.
Database Definition: SQL includes commands for defining and managing database
structures such as tables, indexes, views, and stored procedures. These structures help
organize and optimize data storage and access.
Data Control: SQL offers mechanisms for controlling access to databases and managing
user permissions. This ensures that only authorized users can view or modify sensitive data.
Data Integrity: SQL supports the enforcement of data integrity constraints such as primary
keys, foreign keys, and unique constraints. These constraints help maintain the consistency
and reliability of data within a database.
Transaction Control: SQL provides features for managing database transactions, allowing
users to group multiple database operations into atomic units of work. This ensures that
either all operations within a transaction are completed successfully or none of them are,
maintaining data consistency.
Decision Making: Data-driven decision making relies on analysing data to make informed
choices, whether in business strategy, healthcare, or other fields.
38
lOMoAR cPSD| 45929297
Business Insights: Data can provide valuable insights into customer behaviour, market
trends, and operational efficiency, helping businesses optimize their strategies.
Predictive Analysis: By analysing historical data, organizations can make predictions
about future trends and outcomes, aiding in planning and risk management.
Personalization: Data allows businesses to personalize products, services, and marketing
efforts to better meet the needs and preferences of individual customers.
Performance Monitoring: Monitoring key performance indicators (KPIs) through data
analysis helps organizations track progress towards goals and identify areas for
improvement.
Structured Data: This type of data has a predefined data model or is organized in a tabular
format with a clear schema, making it easy to query and analyze. Examples include data in
relational databases or spreadsheets.
Unstructured Data: Unstructured data lacks a predefined data model and is not organized
in a structured manner. Examples include text documents, images, audio files, and videos.
Analysing unstructured data often requires specialized tools and techniques such as natural
language processing (NLP) or computer vision.
Semi-Structured Data: Semi-structured data falls somewhere between structured and
unstructured data. It may have a flexible schema or tags that provide some structure, but it
does not fit neatly into a relational database. Examples include JSON, XML, and log files.
Transactional Data: Transactional data records specific events or transactions, typically
in a structured format. Examples include sales transactions, financial transactions, and log
entries.
Temporal Data: Temporal data includes information related to time, such as timestamps
or time-series data. It is commonly used in applications where the temporal aspect is
important, such as IoT (Internet of Things) devices, financial markets, and weather
forecasting.
39
lOMoAR cPSD| 45929297
40
lOMoAR cPSD| 45929297
1) Download MySQL Installer: Visit the MySQL website and download the MySQL
Installer for your operating system (Windows, macOS, Linux).
2) Run Installer: Locate the downloaded installer file and double-click it to run the installer.
3) Choose Installation Type: Select your preferred installation type (e.g., "Developer
Default" for standard development setup) and click "Next".
4) Configure MySQL Server: Set the root password for MySQL Server and choose a port
number for MySQL to listen on.
5) Complete Installation: Wait for the installer to finish installing components and
configuring MySQL Server.
EXAMPLE
41
lOMoAR cPSD| 45929297
EXAMPLE
1) SELECT – The SELECT statement in SQL is used to retrieve data from table in a database.
2) WHERE - The WHERE clause is used to filter rows based on a specified condition. It
allows you to retrieve only the rows that meet the specified criteria Syntax - SELECT
4) SELECTION - a selection query filters rows from a table based on specific conditions
42
lOMoAR cPSD| 45929297
6.9 OPERATORS
SQL operators are used to perform operations on data in SQL queries. These are the
basic syntax patterns for using common SQL operators in queries. Keep in mind that the exact
syntax may vary slightly depending on the SQL dialect or database management system you're
using.
ARITHMETIC OPERATORS:
COMPARISON OPERATORS:
CONCATENATION OPERATOR:
43
lOMoAR cPSD| 45929297
IN OPERATOR:
BETWEEN OPERATOR:
IS NULL OPERATOR:
44
lOMoAR cPSD| 45929297
7. CONCLUSION
Python full stack development offers a comprehensive approach to building web applications
using Python for both frontend and backend development. Here is a concise conclusion
highlighting its key aspects:
Python's versatility and simplicity make it an excellent choice for full stack development.
With Python, developers can use the same language across the entire stack, from frontend
to backend, reducing complexity and streamlining development.
For frontend development, Python frameworks like Django and Flask offer powerful tools
for building robust web applications. These frameworks provide features such as routing,
templating, form handling, and authentication, allowing developers to create dynamic and
interactive user interfaces.
On the backend, Python's extensive ecosystem of libraries and frameworks, combined with
its ease of integration with databases and other services, enables developers to build
scalable and efficient server-side applications.
Overall, Python full stack development offers a cohesive and efficient approach to building
modern web applications, leveraging Python's strengths in simplicity, versatility, and extensive
ecosystem of libraries and frameworks. As a result, Python remains a popular and widely-used
technology stack for developers seeking to build robust and scalable web applications.
45