Industrial Training Report On Python New
Industrial Training Report On Python New
ON
PYTHON PROGRAMMING
From
EngineerCore
SUBMITTED BY
1|Page
LIST OF CONTENTS
Title Page 01
Acknowledgement 05
Certificate 06
Declaration by student 07
Organization Introduction 08
List of figure
o Figure no 1 11
o Figure no 2 15
o Figure no 3 16
o Figure no 4 17
o Figure no 5 19
o Figure no 6 21
o Figure no 7 22
o Figure no 8 23
Contents (Report) 09 to
29
1. INTRODUCTION
1.1 Python
2.1 Variable
2.2 String
3.1 Tuple
3.2 List
4.1 Loops
4.3 Function
3|Page
4.3.1 Syntax & Examples
6. CONCLUSION 30
7. REFRENCES 30
ACKNOWLEDGEMENT
First I would like to thank Mr. Gautam Kumar for giving me the opportunity to do
summer training with EngineerCore. Although quite short, for me this was a great
experience I can learn from. It helped me to explore my skills and increased my interest
in web development.
It is indeed with a great sense of pleasure and immense sense of gratitude that I
acknowledge the help of these individuals.
I would like to thank my Assistant Professor Mr. Ravi Shankar Tiwari Sir for his
constructive criticism throughout my internship and for their support and advices to get
and complete internship in above said organization.
I am extremely great full to my department staff members and friends who helped me in
successful completion of this internship.
5|Page
CERTIFICATE FROM INSTITUTE
DECLARATION BY STUDENT
This is to certify that the present summer training report entitled “PYTHON
PROGRAMMING ” is my original work . This summer training fulfil the requirement of
the Bachelor’s in computer application an undergraduates degree of Lucknow University.
7|Page
INTRODUCTION TO INSTITUTE
EngineerCore believe knowledge is power, and They are here to make us invincible. The
cut-throat competition in the field of engineering and the constant need of standing out of
the crowd is not under the covers anymore. It has become a necessity to set ourself apart,
and they are here to help.
Now, we can stand apart by doing our self paced courses along with our college degree so
we can move multiple steps ahead at a time. They help the students get their hands on the
latest technology trends and stay updated.
INTRODUCTION
1.1 Python
9|Page
1.3 Object Oriented Programming Language
1.4 History
Python was conceived in the late 1980s, and its implementation was started in
December 1989 by Guido van Rossum at CWI in the Netherlands as a successor to
the ABC language (itself inspired by SETL) capable of exception handling and
interfacing with the Amoeba operating system. Van Rossum is Python's principal
author, and his continuing central role in deciding the direction of Python is reflected
in the title given to him by the Python community, benevolent dictator for life
(BDFL).
FIG 1.1 Van Rossum
Figure 1
11 | P a g e
"Python is an experiment in how much freedom programmers need. Too much freedom
and nobody can read another's code; too little and expressiveness is endangered. "
- Guido van Rossum
Over six years ago, in December 1989, I was looking for a "hobby" programming
project that would keep me occupied during the week around Christmas. My office
would be closed, but I had a home Computer, and not much else on my hands. I
decided to write an interpreter for the new scripting language I had been thinking about
lately: a descendant of ABC that would appeal to Unix/C hackers. I chose Python as a
working title for the project, being in a slightly irreverent mood (and a big fan of
Monty Python's Flying
Circus).
Chapter 2
DATA TYPES
Data types determine whether an object can do something, or whether it just would not
make sense. Other programming languages often determine whether an operation
makes sense for an object by making sure the object can never be stored somewhere
where the operation will be performed on the object (this type system is called static
typing). Python does not do that.
Instead it stores the type of an object with the object, and checks when the
operation is performed whether that operation makes sense for that object (this
is called dynamic typing).
2.1 Python has many native data types. Here are the important ones:
2.2 Variables
Variables are nothing but reserved memory locations to store values. This means that
when you create a variable you reserve some space in memory.
Based on the data type of a variable, the interpreter allocates memory and decides what
can be stored in the reserved memory. Therefore, by assigning different data types to
variables, you can store integers, decimals or characters in these variables.
Ex:
counter = 100 # An integer
assignment miles = 1000.0 # A
floating point name = "John" # A
string
2.3 String
In programming terms, we usually call text a string. When you think of a string as a
collection of letters, the term makes sense.
All the letters, numbers, and symbols in this book could be a string.
For that matter, your name could be a string, and so could your
address.
2.4 Creating Strings
Figure 2
Figure 4
Chapter 3
TUPLES
To access values in tuple, use the square brackets for slicing along with the index or
indices to obtain value available at that index. For example tupl = ('physics',
'chemistry', 1997, 2000); tup2 = (1, 2, 3, 4, 5, 6, 7); print "tupl[o]: ", tupl[o] print
"tup2[1:5]: ", tup2[1:5]
VVhen the above code is executed, it produces the following result —
tupl[o]: physics tup2[1:5]: [2, 3, 4, 5]
Tuples respond to the + and * operators much like strings; they mean concatenation and
repetition here too, except that the result is a new tuple, not a string. In fact, tuples
respond to all of the general sequence operations we used on strings in the prior chapter
3.3 Built-in Tuple Functions
Figure 5
LIST
The list is a most versatile datatype available in Python which can be written as a list of
comma-separated values (items) between square brackets. Important thing about a list is
that items in a list need not be of the same type. Creating a list is as simple as putting
different comma-separated values between square brackets. For example listl =
['physics', 'chemistry', 1997, 2000]; list2 [l, 2, 3, 4, 5 ]; list3 ["a", "b", "c", "d"];
Similar to string indices, list indices start at 0, and lists can be sliced, concatenated
and so on.
10 | P a g e
3.3 Accessing Values in Lists:
To access values in lists, use the square brackets for slicing along with the index or
indices to obtain value available at that index. For example listl = ['physics',
'chemistry', 1997, 2000]; list2 [l, 2, 3, 4, 5, 6, 7 ]; print "listl ", listl CO] print "list2Cl
:5]: ", list2[l:5]
Figure 6
Chapter 4
LOOPS
4.1 Loops
Programming languages provide various control structures that allow for more
complicated execution paths.
12 | P a g e
Python programming language provides following types of loops to handle looping
requirements.
Figure 7
14 | P a g e
Example:
For Loop:
>>> for mynum in [l, 2, 3, 4,
5]: print "Hello", mynum
Hello
1
Hell
o2
Hel
lo 3
Hell
o4
Hello
5
While Loop:
>>> count = 0
>>> while (count < 4):
print 'The count is:', count
count count + I The
count is: 0
The count is: I
The count is: 2
The count is: 3
Figure 8
Example:
If Statement:
>>> state = "Texas"
>>> if state "Texas".
print "TX
28
If...Else Statement:
>>> if state "Texas"
print "TX" else:
print "[inferior state]"
If...Else...If Statement:
>>> if name "Paige" print
"Hi Paige!" elif name
"Walker": print "Hi
Walker!" else: print
"Imposter!"
14.4 Function
Function blocks begin with the keyword def followed by the function name and
parentheses ( ( )
Syntax:
def
functionname( parameters ):
"function docstring" function
suite return [expression]
Example:
l. def printme( str ):
"This prints a passed string into this
function" print str return
14.5 Directories
Another useful data type built into Python is the dictionary (see Mapping Types
dict). Dictionaries are sometimes found in other languages as "associative memories"
or "associative arrays". Unlike sequences, which are indexed by a range of numbers,
dictionaries are indexed by keys, which can be any immutable type; strings and
numbers can always be keys. Tuples can be used as keys if they contain only strings,
numbers, or tuples; if a tuple contains any mutable object either directly or indirectly, it
cannot be used as a key. You can't use lists as keys, since lists can be modified in place
using index assignments, slice assignments, or methods like append() and extend().
It is best to think of a dictionary as an unordered set of key: value pairs, with the
requirement that the keys are unique (within one dictionary). A pair of braces creates
an empty dictionary: l}. Placing a comma-separated list of key: value pairs within the
braces adds initial key: value pairs to the dictionary; this is also the way dictionaries
are written on output.
28
The main operations on a dictionary are storing a value with some key and extracting
the value given the key. It is also possible to delete a key: value pair with del. If you
store using a key that is already in use, the old value associated with that key is
forgotten. It is an error to extract a value using a non-existent key.
The keys() method of a dictionary object returns a list of all the keys used in the
dictionary, in arbitrary order (if you want it sorted, just apply the sorted()function to
it). To check whether a single key is in the dictionary, use the in keyword.
Chapter 5
+ science
- Bioinformatics
System Administration
-Unix
-Web logic
-Web sphere
• Web Application Development
-CGI
Testing scripts
1. System programming
3. Internet Scripting
4. Component Integration
5. Database Programming
Companies like Google makes extensive use of Python in its web search system,
employs. Python's creator. Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm,
and IBM use Python. For hardware testing. ESR' uses Python as an end-user
customization tool for its popular Gl mappmg products. The YouTube video
sharing service is largely written in Python.
28
5.4 Why Do People Use Python?
Python is object-oriented.
Indentation is one of the greatest future in Python. It's free (open source).
30 | P a g e
CONCLUSION
Practical knowledge means the visualization of the knowledge, which we read in our
books. For this, we perform experiments and get observations. Practical knowledge is
very important in every field. One must be familiar with the problems related to that field
so that he may solve them and become a successful person.
After achieving the proper goal in life, a student has to enter in professional life.
According to this life, he has to serve an industry, may be public or private sector or
selfown. For the efficient work in the field, he must be well aware of the practical
knowledge as well as theoretical knowledge.
Due to all above reasons and to bridge the gap between theory and practical, our
BCA curriculum provides a summer training of 45 days. During this period a student
work in the industry and get well all type of experience and knowledge about the working
of companies and hardware and software tools. I have undergone my 45 days summer
training in 5 sem at EngineerCore . This report is based on the knowledge, which I
acquired during my 45 days of summer training.
References
Training report.
Python For Everybody.
Think python.
www.python.org
Google group: javatechzo ne.