Professional Documents
Culture Documents
Introduction To Python 27-Nov-2021
Introduction To Python 27-Nov-2021
Archit A. Vohra
About Python
Guido Van Rossum.
Interpreted.
Extensible, Embeddable.
Installing Python
Current version of Python 3.9.7 or 3.10
https://www.python.org/downloads/
Escape Sequences \ .
Raw string.
The rest of the identifier name can consist of alphabet, number or ‘_’.
Python has the following data types built-in by default, in these categories:
Text Type: str
Numeric Types: int, float, complex
Sequence Types: list, tuple, range
Mapping Type: dictionary
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray, memoryview
Operators in Python
Arithmetic Operators : **, %, //.
Assignment Operators :
Logical Operators :
Examples of real number includes 4, 12.87, -6, 3/5, √2; Most of the numbers
are real numbers.
Hence the numbers line 3j, 8+j etc. are complex numbers.
Strings in Python
String literals in python are surrounded by either single quotation marks, or
double quotation marks.
“”” (triple quotes) are used to assign multiple line of text to a string.
Length of the string can be found out using the len() function.
To get any kind of data from user the input() can be used.
If <condition1>:
elif <condition2>:
……….
else: