Professional Documents
Culture Documents
Lakshita ITppt
Lakshita ITppt
• system scripting.
Features of Python
• Python was designed for readability, and has some similarities to the English
language with influence from mathematics.
Python Syntax
Example :-
>>>print("Hello, World!")
Hello, World!
Python Data Types
In programming, data type is an important concept.
Variables can store data of different types, and different types can do different things.
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: dict
Set Types: set, frozenset
Boolean Type: bool
Binary Types: bytes, bytearray, memoryview
In Python, the data type is set when you assign a value to a variable
Example :-
x=5
print(x)
Conditional Statements in Python
• If else and elif in python
If else and elif statements are a multiway decision taken by our program due to certain condition in our
code.
• Relational operator
it is used to evaluate conditions inside the if statements. Some examples of relational operators are:
● Logical operators
example:
● While loop
The syntax of a while loop
While condition:
#body of the loop
● For loop:
For loop is used to iterate through a sequence like list ,tuple or string[iterables]
Syntax: l=[1 ,7,8]
For item in l:
Print (item)
THANK YOU