0% found this document useful (0 votes)
6 views3 pages

Ultimate Python Notes: Basics & Syntax

Ultimate Python Notes – Part 1 introduces Python as a high-level, interpreted, and object-oriented programming language, highlighting its simplicity, powerful features, and broad applications. It covers essential concepts such as variables, data types, operators, input/output, and conditional statements with examples. The document serves as a foundational guide for beginners, with a promise of further topics in Part 2.

Uploaded by

gorthyvyshuu
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)
6 views3 pages

Ultimate Python Notes: Basics & Syntax

Ultimate Python Notes – Part 1 introduces Python as a high-level, interpreted, and object-oriented programming language, highlighting its simplicity, powerful features, and broad applications. It covers essential concepts such as variables, data types, operators, input/output, and conditional statements with examples. The document serves as a foundational guide for beginners, with a promise of further topics in Part 2.

Uploaded by

gorthyvyshuu
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

■ Ultimate Python Notes – Part 1 (Easy

Revision Edition)

■ Chapter 1: Introduction to Python


Python is a high-level, interpreted, and object-oriented programming language. It is simple,
powerful, and widely used for automation, data analysis, web development, AI, and more.

Features of Python:
■ Easy to read and write (uses simple English).
■ Free and open-source.
■ Platform independent (runs anywhere).
■ Large community support.
■ Rich library support for every task.

Example:
print('Hello, World!')
■ Output: Hello, World!

Comments:
Used to explain code for humans.
# This is a single-line comment
""" This is a multi-line comment """
Indentation: Python uses spaces to define code blocks.
if True: print('Yes, this is Python!')

■ Chapter 2: Variables & Data Types


Variables are like containers that store data values.

Example:
name = 'Vyshuu' age = 20 print(name, age)

Common Data Types:


Type Example Description
int 10 Whole numbers
float 10.5 Decimal numbers
str 'Hello' Text data
bool True / False Logical values
list [1, 2, 3] Ordered, changeable collection
tuple (1, 2, 3) Ordered, unchangeable collection
set {1, 2, 3} Unordered, unique items
dict {'name':'Vyshuu'} Key-value pairs

Type Casting:
x = int(5.6) # 5
y = float(3) # 3.0
z = str(100) # '100'

Operators:
Used to perform operations on variables and values.
■ Arithmetic: +, -, *, /, %, **
■ Comparison: ==, !=, >, <, >=, <=
■■ Logical: and, or, not
■ Assignment: =, +=, -=, *=, /=

■ Chapter 3: Input & Output


Output: Use print() to display text or variables.
print('My name is Vyshuu')
■ Output: My name is Vyshuu

Input: Use input() to get data from the user.


name = input('Enter your name: ') print('Hello', name)

Formatting Output:
age = 20 print(f'My age is {age}')
■ Output: My age is 20

■ Chapter 4: Conditional Statements


Conditional statements are used to make decisions in code.

if Statement:
x = 10 if x > 5: print('x is greater than 5')

if...else:
x = 3 if x % 2 == 0: print('Even') else: print('Odd')

if...elif...else:
marks = 85 if marks >= 90: print('A Grade') elif marks >= 75: print('B
Grade') else: print('C Grade')

Short-hand if:
a, b = 5, 10 print('A') if a > b else print('B')

■ End of Part 1 – Continue with Part 2 for Loops, Functions, and Data Structures.

You might also like