Python Theory
Python Theory
What is Python?
• Python is a general purpose programming
language and a scripting language.
• Often, it is applied in scripting roles.
• It’s also called an interpreted language.
History of Python
• Invented in early 90s by Guido Van Rossum in
Netherlands.
• It was conceived in 1980s and its
implementation was started in December, 1989.
• Guido Van Rossum is a fan of “Monty Python’s
Flying Circus” TV show.
• Named after Monty Python.
• Open sourced from the beginning.
Scope of Python
• Science → Bio-informatics
• System administration
◦ Unix
◦ Web Logic
◦ Web Sphere
• Web Application Development
◦ CGI
◦ Jython
• Servlets Testing
◦ Scripts
Operators in Python
// → Returns the whole part after division
** → Exponent
Data Types
• Booleans
• Numbers (Int, Float, Fractions)
• Strings
• Lists
• Tuples
• Sets
• Byte, Byte arrays
Eg:-
a = “DK
Pattammal”
print(type(a))
O/P:
<type ‘str’>
Function Does
sum() Returns sum of all value is list/tuple
min() Returns smallest value in list/tuple
max() Returns largest value in list/tuple
len() Returns the no. of values in list/tuple
list()/tuple() Converts list/tuple to tuple/list
SYNTAX
List:-
a = [1, 2, 3]
Tuple
a = (1, 2, 3)
Chapter 3 – Introduction to
Turtle module
SYNTAX:-
import <module>
(or)
from <module> import
*