0% found this document useful (0 votes)
1 views10 pages

Python Class 6

Intro of python

Uploaded by

Himanshu Kumar
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)
1 views10 pages

Python Class 6

Intro of python

Uploaded by

Himanshu Kumar
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

Python Notes for Grade 6

Chapter 1: Introduction to Python


Python is a high-level programming language.
It is easy to learn and understand.
Python is used to create games, websites,
apps, and robots.

Features of Python
 Simple and easy to read
 Free and open-source
 Works on different operating systems
 Supports graphics and games
Starting Python
First Python Program
print("Hello, World!")
Output:
Hello, World!
The print() Function
It displays text or numbers on the screen.
print("Welcome to Python")
print(10)
---
Variables
Variables are used to store information.
name = "Rita"
age = 11
Display Variables
print(name)
print(age)
Output:
Rita
11
Data Types
Data Type Example
Integer (int) 25
Float 3.14
String (str) "Hello"
Boolean (bool) True, False
Example:
num = 10
pi = 3.14
name = "Rita"
---
Input from User
name = input("Enter your name: ")
print("Hello", name)
---
Chapter 6: Operators
Arithmetic Operators
Operator Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
% Remainder
Example:
a = 10
b=5
print(a + b)
print(a - b)
print(a * b)
print(a / b)
---
Decision Making
if Statement
marks = 80
if marks >= 40:
print("Pass")
if-else Statement
marks = 35
if marks >= 40:
print("Pass")
else:
print("Fail")
Loops for Loop
for i in range(1, 6):
print(i)
Output:
1
2
3
4
5
while Loop
count = 1
while count <= 5:
print(count)
count += 1
---
Lists
A list stores multiple values.
fruits = ["Apple", "Mango", "Banana"]
print(fruits)
Access List Items
print(fruits[0])
Output:
Apple
Functions
Functions help us reuse code.
def greet():
print("Good Morning")
greet()
Function with Argument
def greet(name):
print("Hello", name)
greet("Rita")
---
Simple Programs
Add Two Numbers
a = 12
b=8
print("Sum =", a + b)
Check Even or Odd
num = 10
if num % 2 == 0:
print("Even Number")
else:
print("Odd Number")
---
Important Terms
Program: A set of instructions for a computer.
Variable: Stores data.
Loop: Repeats a task.
Function: A reusable block of code.
List: Stores multiple items.
Quick Revision
✅ print() → Display output
✅ input() → Take input
✅ Variable → Store data
✅ Operators → Perform calculations
✅ if-else → Make decisions
✅ Loops → Repeat actions
✅ List → Store many values
✅ Function → Reuse code

You might also like