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

Python Basics Notes

The document provides an overview of Python basics, including its beginner-friendly nature and the use of the print() function. It covers key concepts such as variables, data types, and various operators including arithmetic, comparison, and logical operators. Examples are provided to illustrate the use of these concepts in Python programming.

Uploaded by

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

Python Basics Notes

The document provides an overview of Python basics, including its beginner-friendly nature and the use of the print() function. It covers key concepts such as variables, data types, and various operators including arithmetic, comparison, and logical operators. Examples are provided to illustrate the use of these concepts in Python programming.

Uploaded by

saweranadeem693
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Python Basics - Study Notes

1. Introduction to Python
• Python is a beginner-friendly, easy-to-read programming language.
• print() function is used to display output on the screen.
Example: print("Hello, World!")

2. Variables
• Variables are names used to store data values.
• Python automatically detects the data type.
Examples:
name = "Ali"
age = 18
is_student = True

3. Data Types
• int: Whole numbers → age = 20
• float: Decimal numbers → height = 5.9
• str: Text → name = "Sara"
• bool: True/False → is_active = False
• Other common types: list, dict

4. Operators
A. Arithmetic Operators

• + (Addition)
• - (Subtraction)
• * (Multiplication)
• / (Division)
• // (Floor Division)
• % (Modulus)
• ** (Exponentiation)

B. Comparison Operators

• == (Equal to)
• != (Not equal to)
• > (Greater than)
• < (Less than)
• >= (Greater than or equal to)
• <= (Less than or equal to)

C. Logical Operators

• and (Both conditions are true)


• or (At least one condition is true)
• not (Reverses the condition)

You might also like