0% found this document useful (0 votes)
7 views2 pages

Python Full Notes

The document provides a comprehensive overview of Python basics, focusing on various types of operators including arithmetic, comparison, logical, assignment, membership, and identity. It includes real-time examples demonstrating the use of these operators and conditional statements. Additionally, it covers the implementation of a for loop in Python.

Uploaded by

javahost07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Python Full Notes

The document provides a comprehensive overview of Python basics, focusing on various types of operators including arithmetic, comparison, logical, assignment, membership, and identity. It includes real-time examples demonstrating the use of these operators and conditional statements. Additionally, it covers the implementation of a for loop in Python.

Uploaded by

javahost07
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Python Basics – Complete Notes with Real-Time

Examples

Operators

Operators are symbols used to perform operations on values or variables.

Arithmetic Example
price = 500
quantity = 2
print(price * quantity)

Comparison Example
marks = 40
print(marks >= 35)

Logical Example
marks = 80
attendance = 70
if marks >= 50 and attendance >= 75:
print('Eligible')
else:
print('Not Eligible')

Assignment Example
balance = 1000
balance += 500
print(balance)

Membership Example
items = ['milk','bread']
print('milk' in items)

Identity Example
a = [1,2,3]
b = a
print(a is b)

Conditional Statements
age = 20
if age >= 18:
print('Adult')

For Loop Example


for i in range(1,6):
print(i)

You might also like