Professional Documents
Culture Documents
TECHNOLOGY
This report has been prepared for the internship that has been hosted
by “TECHNOPHILIA” in order to study the practical aspects of the
course and implementation of the theory in the real field with the
purpose of fulfilling the requirements of the course “PYTHON
PROGRAMMING”.
The aim of the internship is to be familiar to the practical aspects and
uses of theoretical knowledge and clarifying the career goals,so I have
successfully completed the internship and while this report as the
summary and the conclusion that have drawn from the internship
experience.
I would like to express my sincere gratitude to our internship
coordinator who have given their valuable time and given me a chance
to learn something despite having their busy schedule.I am also
thankful this and other members for their cooperative support,and also
presenting with an opportunity for me to have a practical experience by
this project.
LIST OF CONTENTS
CHAPTER TOPIC
NO.
1. INTRODUCTION
1.1 Python
2.2 String
4.3 Function
6. CONCLUSION
7. REFERENCES
Chapter 1
INTRODUCTION
1.1 Python
Python is a widely uses high-level,interpreted,dynamic programming
language.Its design philosophy emphasizes code readability,and its syntax
allows programmers to express concept in fewer lines of code than would
be possible in languages such as C++ or Java.The language provides
constructs intended to enable clear programs on both a small and large
scale.Python supports multiple programming paradigms,including object-
oriented,imperative and functional programming or procedural
styles.Python interpreters are available for installation on many operating
systems,allowing Python Code execution on a wide variety of systems.
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).
Python has many native data types. Here are the important ones:
Booleans are either True or False.
Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions (1/2 and
2/3).
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.
2.2 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.
Creating Strings
3.1 Tuple
Creating a tuple is as simple as putting different comma-separated values.
Optionally you can put these comma-separated values between parentheses
also. For example –
tup1[0]
tup1[0]: physics
tup2[1:5]: [2, 3, 4, 5]
Output: list1[0]:physics
list2[1:5]: [2,3,4,5]
4.1 Loops
For Loop:
>>> for mynum in [1, 2, 3, 4]:
print "Hello", mynum Hello
1
Hello
2
Hello
3
Hello
4
While Loop:
>>> count = 0
>>> while (count < 4): print
'The count is:', count count =
count + 1
The count is: 0
The count is: 1
The count is: 2
The count is: 3
If Statement:
>>> state = “Texas”
>>> if state == “Texas”:
print “TX
TX
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!”
4.3 Function
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. You can also define parameters inside these parentheses. The
first statement of a function can be an optional statement - the
documentation string of the function.
The code block within every function starts with a colon (:) and is indented.
Syntax:
def functionname( parameters ):
"function_docstring"
function_suite
return [expression]
Example:
1. def printme( str ):
"This prints a passed string into this function"
print str
return
2. # Function definition is here
def printme( str ):
"This prints a passed string into this function"
Directories
Another useful data type built into Python is the dictionary.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().
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.
Here is a small example using a dictionary:
Chapter 5
Science
– Bioinformatics
System Administration
-Unix
-Web Logic
-Web Sphere
Web Application Development
-CGI
Testing Scripts
a) Python is object-oriented.
c) Indentation is one of the greatest future in Python. It's free (open source)
CONCLUSIONS
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.
Due to all above reasons and to bridge the gap between theory and
practical, our Engineering curriculum provides a practical training of 30 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.
a) Training report.
c) Think python.
d) www.python.org