Reminder Java Application

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

CHAPTER-I

INTRODUCTION

Python was invented by Guido van Rossum in 1991 at CWI in Netherland. The idea
of Python programming language has taken from the ABC programming language or we can
say that ABC is a predecessor of Python language.

There is also a fact behind the choosing name Python. Guido van Rossum was a fan
of the popular BBC comedy show of that time, "Monty Python's Flying Circus". So he
decided to pick the name Python for his newly created programming language.

Python tutorial provides basic and advanced concepts of Python. Our Python tutorial
is designed for beginners and professionals. Python is a simple, general purpose, high level,
and object-oriented programming language. Python is an interpreted scripting language also.
Guido Van Rossum is known as the founder of Python programming.

Our Python tutorial includes all topics of Python Programming such as installation, control
statements, Strings

➢ Lists
➢ Tuples
➢ Dictionary
➢ Modules
➢ Exceptions
➢ Date and Time, File I/O, Programs, etc.

There are also given Python interview questions to help you better understand Python
Programming. Python is a general purpose, dynamic, high-level and interpreted programming
language. It supports Object Oriented programming approach to develop applications. It is
simple and easy to learn and provides lots of high-level data structures. Python is easy to learn
yet powerful and versatile scripting language, which makes it attractive for Application
Development.

1
Python's syntax and dynamic typing with its interpreted nature make it an ideal language
for scripting and rapid application development. Python supports multiple programming
pattern, including object-oriented, imperative, and functional or procedural programming
styles.Python is not intended to work in a particular area, such as web programming. That is
why it is known as multipurpose programming language because it can be used with web,
enterprise, 3D CAD, etc.

We don't need to use data types to declare variable because it is dynamically typed so we
can write a=10 to assign an integer value in an integer variable. Python makes the
development and debugging fast because there is no compilation step included in Python
development, and edit-test-debug cycle is very fast.

Python provides many useful features to the programmer. These features make it most
popular and widely used language. We have listed below few-essential feature of Python.
Python is a general-purpose, popular programming language and it is used in almost every
technical field.

2
CHAPTER-II
SIMPLE PYTHON PROGRAM

The lines starting with >>> are the


commands you should type while the lines after the commands show the
results.
>>> 2+3
5 >>> 3>2
True
>>> print (‘Hello World’)
Hello World

When you type 2+3, you are issuing a command to the Shell, asking it to
evaluate the value of 2+3. Hence, the Shell returns the answer 5. When
you type 3>2, you are asking the Shell if 3 is greater than 2. The Shell
replies True. Finally, print is a command asking the Shell to display
the line Hello World. The Python Shell is a very convenient tool for testing Python
commands, especially when we are first getting started with the language.

If you exit from the Python Shell and enter it again, all the commands you type will be
gone. In addition, you cannot use the Python Shell to create an actual program. To code an
actual program, you need to write your code in a text file and save it with a .py extension.
This file is known as a Python script.
.

CHAPTER-III
DATA TYPES

All data values in Python are objects and each object or value has type. Python has Built-in
or Fundamental data types such as Number, String, Boolean, tuples, lists and dictionaries.

NUMBER DATA TYPE:


The built-in number objects in Python supports integers, floating point numbers and complex
numbers.

3
Integer Data can be decimal, octal or hexadecimal. Octal integer use O (both upper and lower
case) to denote octal digits and hexadecimal integer use OX (both upper and lower case) and
L (only upper case) to denote long integer.

EXAMPLE:
102, 4567, 567 # Decimal integers
O102, o876, O432 # Octal integers
OX102, oX876, OX432 # Hexadecimal integers
34L, 523L # Long decimal integers

BOOLEAN DATA TYPES:


A Boolean data can have any of the two values: True or False.

EXAMPLE:
Bool_var1=True
Bool_var2=False

STRING:

String data can be enclosed with single quote or double quote or triple quote.

EXAMPLE:

Char_data = ‘A’

String_data= "Computer Science"

Multiline_data= ”””String data can be enclosed with single quote or double quote or triple
quote.”””

4
CHAPTER-IV
CONSTRUCTOR
A constructor is a special type of method (function) which is used to initialize the
instance members of the class.
In C++ or Java, the constructor has the same name as its class, but it treats constructor
differently in Python. It is used to create an object.
Constructors can be of two types.
1. Parameterized Constructor
2. Non-parameterized Constructor
Constructor definition is executed when we create the object of this class. Constructors
also verify that there are enough resources for the object to perform any start-up task.

Example
class Employee:
def __init__(self, name, id):
self.id = id
self.name = name
def display(self):
print("ID: %d \nName: %s" % (self.id, self.name))
emp1 = Employee("John", 101)
emp2 = Employee("David", 102)
emp1.display()
emp2.display()

OUTPUT
ID: 101
Name: ADHI
ID: 102
CHAPTER-V
CONDITIONAL STATEMENT

All control flow tools involve evaluating a condition statement. The


program will proceed differently depending on whether the condition is
met.

IF:
if is the simplest of all decision making statements. Condition should be in the form of
relational or logical expression.

Syntax:
if <condition>:
statements-block1

5
.

IF ELSE:

The if .. else statement provides control to check the true block as well as the false block.
Following is the syntax of ‘if..else’ statement.

Syntax:
if <condition>:
statements-block 1
else:
statements-block 2

LOOPS:

WHILE LOOP:

The syntax of while loop in Python has the following syntax:

Syntax:
while <condition>:
statements block 1
[else:
statements block2]

FOR:

for loop is the most comfortable loop. It is also an entry check loop. The condition is checked
in the beginning and the body of the loop(statements-block 1) is executed if it is only True
otherwise the loop is not executed.

Syntax:
for counter_variable in sequence:
statements-block 1
[else: # optional block
statements-block 2]

6
CHAPTER-VI
CONCLUSION

It is a flexible tool that allows both the teaching of traditional procedural programming
and modern OOP; It can be used to teach a large number of transferable skills; It is a real
world programming language that can be and is used in academia and the commercial world;
It appears to be quicker to learn and, in combination with its many libraries, this offers
the possibility of more rapid student development allowing the course to be made more
challenging and varied; It is trivial to install on a Windows PC allowing students to take their
interest further.
For many the hurdle of installing a Pascal or C compiler on a Windows machine is
either too expensive or too complicated and most importantly, its clean syntax offers
increased understanding and enjoyment for students

You might also like