Professional Documents
Culture Documents
ON
Bachelor of Technology
In
This project has been made possible through the direct and indirect
cooperation of various persons, who have inspired me at every step of my
work. It is a matter of pride for me to acknowledge my profound
gratitude to my esteemed project guides under Mr. Sarvesh Agrawal Sir
for his valuable co-operation and guidance and providing me the
opportunity to pursue my training at the institute.
Place:New Delhi.
B.Tech (CSE)
PREFACE
There are numbers of IT companies like Google, Facebook, Yahoo, IBM etc, that uses
Python for various purpose. Python is used in Data Science and analysis of data. It is
helpful to learn the Machine Learning Technique. When he began implementing Python,
Guido van Rossum was also reading the published scripts from “Monty Python's Flying
Circus”, a BBC comedy series from the 1970s. Van Rossum thought he needed a name
that was short, unique, and slightly mysterious, so he decided to call the language Python
ORGANIZATIONAL INTRODUCTION
Internshala is a wonderful platform for learning and gaining knowledge through the vast
orgainsed resourses for a particular course. Moreover they have weekly assignment
system so to track down your progress. The best part is that the course materials are
downloadable so you dont need internet for accessing them always and save the video
and refer it to a later stage.
Internshala Offers large numbers of courses for Summer Training, Winter training.It also
provides you opportunity to find a suitable internship. May be work from home or part
time or full time. Internshala is there to cover up all. Internshala’s CEO name is
MR.Sarvesh Agrawal.Its head quarter is in Gurugram(Haryana) and started in 2010.It is a
plate form which provide internship of engineering student as well as commerce student.
Here, you can apply for part time internship, full time internship and home-based intern.
If you want to do training in courses and work on any technology, here you can purchase
the course of all type and can learn. It provides internship resources and career services to
students and employers. The site offers internship searching and posting, and other career
services such as counselling, cover-letter writing, resume building and training programs
to students.
Table of Contents
Page No
Scripting languages are often interpreted (rather than compiled). Primitives are usually the
elementary tasks or API calls, and the language allows them to be combined into more complex
programs. Environments that can be automated through scripting include software applications,
web pages within a web browser, the shells of operating systems (OS), embedded systems, as
well as numerous games.
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
(http://www.python.org/download/).
Now that you are on the download page, select which of the software builds you would like to
download. For the purposes of this article we will use the most up to date version available
(Python 3.7.0).
Once you have the “Environment Variables” window open, direct your focus to the bottom half.
You will notice that it controls all the “System Variables” rather than just this associated with
your user. Click on “New…” to create a new variable for Python
Simply enter a name for your Path and the code shown below. For the purposes of this
example we have installed Python 2.7.3, so we will call the path: “Pythonpath.”
Once the GUI is open, we will begin by using the simplest directive possible. This is the “print”
directive which simply prints whatever you tell it to, into a new line. Start by typing a print
directive like the one shown in the image below or copy and paste this text then press “Enter”:
print (“Congratulations on executing your first print directive”)
2.5) Python Code Execution
Python’s traditional runtime execution model: source code you type is translated to byte code,
which is then run by the Python Virtual Machine. Your code is automatically compiled, but then
it is interpreted.
Python has many native data types. Here are the important ones:
Numbers can be integers (1 and 2), floats (1.1 and 1.2), fractions (1/2 and 2/3), or even complex
numbers.
3.1) Variable
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
Miles = 1000.0
Name = "John"
3.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
In Python, we create a string by putting quotes around text. For example, we could take our
otherwise useless
len("hello") 5 # size
Arithmetic Operator
a. Addition(+)
Adds the values on either side of the operator.
1. >>> 3+4
2. 7
b. Subtraction(-)
Subtracts the value on the right from the one on the left.
1. >>> 3-4
2. -1
c. Multiplication(*)
Multiplies the values on either side of the operator.
1. >>> 3*4
2. 12
d. Division(/)
Divides the value on the left by the one on the right. Notice that division results in a floating-
point value.
1. >>> 3/4
2. 0.75
e. Exponentiation(**)
Raises the first number to the power of the second.
1. >>> 3**4
2. 81
f. Floor Division(//)
Divides and returns the integer value of the quotient. It dumps the digits after the decimal.
1. >>> 3//4
2. 0
3. >>> 4//3
4. 1
5. >>> 10//3
6. 3
COMPARISION OPERATOR
Relational Python operator carries out the comparison between operands. They tell us whether an
operand is greater than the other, lesser, equal, or a combination of those.
a. Less than(<)
This operator checks if the value on the left of the operator is lesser than the one on the right.
1. >>> 3<4
2. True
b. Greater than(>)
It checks if the value on the left of the operator is greater than the one on the right.
1. >>> 3>4
2. False
c. Less than or equal to(<=)
It checks if the value on the left of the operator is lesser than or equal to the one on the right.
1. >>> 7<=7
2. True
d. Greater than or equal to(>=)
It checks if the value on the left of the operator is greater than or equal to the one on the right.
1. >>> 0>=0
2. True
e. Equal to(= =)
This operator checks if the value on the left of the operator is equal to the one on the right. 1 is
equal to the Boolean value True, but 2 isn’t. Also, 0 is equal to False.
1. >>> 3==3.0
2. True
3. >>> 1==True
4. True
5. >>> 7==True
6. False
7. >>> 0==False
8. True
9. >>> 0.5==True
10. False
f. Not equal to(!=)
It checks if the value on the left of the operator is not equal to the one on the right. The Python
operator <> does the same job, but has been abandoned in Python 3.
When the condition for a relative operator is fulfilled, it returns True. Otherwise, it returns False.
You can use this return value in a further statement or expression.
1. >>> 1!=-1.0
2. False
3. >>> -1<>-1.0
#This causes a syntax error
LOGICAL OPERATOR
These are conjunctions that you can use to combine more than one condition. We have three
Python logical operator – and, or, and not that come under python operators.
a. and
If the conditions on both the sides of the operator are true, then the expression as a whole is true.
1. >>> a=not(0)
2. >>> print(a)
3. True
Chapter-: 4
4.1) TUPLES
A tuple is a sequence of immutable Python objects. Tuples are sequences, just like lists. The
differences between tuples and lists are, the tuples cannot be changed unlike lists and tuples use
parentheses, whereas lists use square brackets.
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 −
tup2 = (1, 2, 3, 4, 5 );
For example :-
tup2 = (1, 2, 3, 4, 5, 6, 7 );
tup1[0]: physics
tup2[1:5]: [2, 3, 4, 5]
4.2) 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.
list2 = [1, 2, 3, 4, 5 ];
Similar to string indices, list indices start at 0, and lists can be sliced, concatenated
and so on.
list2 = [1, 2, 3, 4, 5, 6, 7 ];
Output:list1[0]: physics
list2[1:5]: [2, 3, 4, 5]
print list[2]
list[2] = 2001;
print list[2]
Output:Value available at index 2 : 1997
print list1
del list1[2];
print list1
['physics', 'chemistry', 1997, 2000]
Output:After deleting value at index 2 : ['physics', 'chemistry', 2000]
4.2.2) Basic List Operation
Python Expression Results Description
Chapter-: 5
5.1) Loops
Programming languages provide various control structures that allow for more complicated
execution paths.
variable.
Example:
For Loop:
Hello 1
Hello 2
Hello 3
Hello 4
Hello 5
While Loop:
count = 0
count = count + 1
Conditional Statements:
Decision making is anticipation of conditions occurring while execution of the program and
specifying actions taken according to the conditions.
Decision structures evaluate multiple expressions which produce TRUE or FALSE as outcome.
You need to determine which action to take and which statements to execute if outcome is
TRUE or FALSE otherwise
Statement Description
is FALSE.
Example:
If Statement
state = “Texas”
TX
If...Else Statement:
else:
If...Else...If Statement:
else:
print “Imposter!”
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.
The statement return [expression] exits a function, optionally passing back an expression to the
caller. A return statement with no arguments is the same as return None.
Syntex:
"function_docstring"
function_suite
return [expression]
Example:
1. def printme( str ):
print str
return
return;
# Now you can call printme function printme("I'm first call to user defined function!")
printme("Again second call to the same function")
Chapter-: 6
Scope of Python
Science
-Bioinformatics
System Administration
-Unix
-Web logic
-Web sphere
Testing scripts
Internet Scripting
Component Integration
Database Programming
Google makes extensive use of Python in its web search system, and employs
Python’s creator.
Intel, Cisco, Hewlett-Packard, Seagate, Qualcomm, and IBM use Python for hardware
testing.
Why Do People Use Python?
The following primary factors cited by Python users
seem to be these:
Python is object-oriented
Indentation
It's powerful
o Dynamic typing
o Library utilities
It's portable
Chapter-:7
7.1 Introduction-
A fantasy cricket league GUI is a type of game where participants assemble imaginary to prepare
a virtual team of virtual players of a professional sport. Fantasy cricket league is part of the sports
genre where people create a virtual team of virtual cricket players and score points depending on
the performance of the players in the real match. The Fantasy Cricket Match will be based on
batting and bowling orders which are part of the team strategy.
The league participant needs to select a team of 11 players from the pool of players playing the
match. The main aim of the team creation will be outscoring of the opponent by as big margin as
possible.The demand and popularity of the league makes it a popular game which is based on the
performance of your selected players in the live match. A scorecard will be created for the match
using the players you selected.
There should be a proper mix of bowlers, batsman, all-rounders and a wicketkeeper in the team.
The batting innings in the scorecard are updated with the players Runs Scored & Ball Faced from
the live match. Select the players who are more likely to win you the live match and hence end up
with huge points in the fantasy league.
In fantasy cricket league GUI, you can win the league by maximizing your points in cricket
match. The rank or position will be given according to your points and winner is selected
according to points. This GUI is implemented using the Qt designer framework of Python GUI.
The database used with this is Sqlite Database.You can create team and you can also evaluate the
team and players points.
7.2.1-Main Window:-
On main window display, you have to manage the team in a way such that you can create the
team, open the team details etc. You can choose players from different category like all-rounder,
bowler etc.
7.2.2-Create new Team-On main window display, you can create the team by choosing the
batsmen, bowler, all-rounder and bowler. There is a limit of choosing the number of players
fromeach category and also limits of points.
7.2.3- Open team detail-
If you want to analyse or see the team players name ,in the option
you can open the team by the team name.
In the evaluation of team, you can see points of every players in the
match and total team score in the match.
7.3 SQlite Database-
To implement the GUI of cricket league, the database is used is sqlite
database. It store the players name and points.
CONCLUSION
There are many application that has been developed for fantasy cricket league. I developed this
GUI based application for the purpose of learning and adopt to new skill in Pyhton. In this GUI
based application, user can create the team and select the team players. The data base used in this
is sqlite database. With the help of QT designer framework , we have to create the GUI of this
application.
REFERENCES
1)www.javatpoint.com
2)www.python,org
3)www.w3school.com
4)www.tutorialspoint.com
5)www.programiz.com
BIBLIOGRAPHY
1)Learning Python, 5th edition( Mark Lutz)