
Python _ IX
Presentation
•
Other
•
9th Grade
•
Practice Problem
•
Hard
SUNAYANA R
Used 16+ times
FREE Resource
56 Slides • 10 Questions
1
PYTHON
2
3
PYTHON FOR AI
4
5
DOWNLOADING PYTHON
6
PYTHON IDLE INSTALLATION
7
8
9
10
11
12
Fill in the Blanks
13
PYTHON COMMENTS
• A comment is text that doesn't affect the outcome of a code, it is just a
piece of text to let someone know what you have done in a program or
what is being done in a block of code.
14
Fill in the Blanks
15
PYTHON KEYWORDS AND
IDENTIFIERS
16
17
Multiple Select
Pick the keywords in Python
While
input
true
18
VARIABLES
• A variable is a named location used to store data in the memory.
• It is helpful to think of variables as a container that holds data which can be
changed later throughout programming.
19
VARIABLE NAMING CONVENTIONS
20
Multiple Choice
An identifier cannot start with a digit.
True
False
21
ASSIGNING VALUE TO A VARIABLE
• Assignment operator is used in Python to assign values to variables.
• For example, a = 5 is a simple assignment operator that assigns the value 5
on the right to the variable a on the left.
22
ARITHMETIC OPERATORS
23
Multiple Choice
Integer division operator in Python is ____________
//
\\
/
%
24
PYTHON INPUT AND OUTPUT
We use the print() function to output data to the standard output device
(screen).
In python, input() function is used to take user’s input in the program.
25
PYTHON DATATYPES
26
NUMBERS DATATYPE
• Integer & Long Integer
• Range of an integer in Python can be from -2147483648 to 2147483647, and
long integer has unlimited range subject to available memory.
• Integers are the whole numbers consisting of + or – sign with decimal digits
like 100000, -99, 0, 17.
• While writing a large integer value, don’t use commas to separate digits.
Also, integers should not have leading zeros.
• Floating Point
• Numbers with fractions or decimal point are called floating point numbers. A
floating-point number will consist of sign (+,-) sequence of decimals digits
and a dot such as 0.0, -21.9, 0.98333328, 15.2963.
27
SEQUENCE DATATYPE
• A sequence is an ordered collection of items, indexed by positive integers.
• It is a combination of mutable and non-mutable data types.
• Three types of sequence data type available in Python are:
a) String
b) Lists
c) Tuples
28
MUTABLE VS IMMUTABLE
29
ORDERED VS UNORDERED
30
STRING
String is an ordered sequence of letters/characters.
They are enclosed in single quotes (‘ ‘) or double (“ “).
The quotes are not part of string.
They only tell the computer where the string constant begins and ends.
They can have any character or sign, including space in them.
31
LISTS
• Lists List is also a sequence of values of any type.
• Values in the list are called elements / items.
• These are indexed/ordered. List is enclosed in square brackets.
•
Example:
32
TUPLES
• Tuples are a sequence of values of any type, and are indexed by integers.
They are immutable. Tuples are enclosed in ().
33
SETS
• Set is an unordered collection of values, of any type, with no duplicate entry.
34
DICTIONARIES
• Dictionary is an unordered collection of key-value pairs.
• It is generally used when we have a huge amount of data.
35
36
Multiple Choice
dob = [19,"January",1990] is an example of _____________ in Python.
Tuple
Set
Dictionary
List
37
Multiple Choice
x= (5, 'program', 2.5) is an example of ____________ in Python
List
Tuple
Set
38
Type Conversion
• The process of converting the value of one data type
(integer, string, float, etc.) to another data type is called
type conversion.
•
Python has two types of type conversion.
.
1.Implicit Type Conversion
2. Explicit Type Conversion
39
Implicit type conversion
Python automaticall.y converts one data type to another data type.
40
Explicit type conversion (Type casting)
In Explicit Type Conversion, users convert the data type of an object to
required data type. We use the predefined functions like int(), float(),
str(), etc to perform explicit type conversion
41
List Methods
•
Creating a list:
In Python programming, a list is created by placing all the items (elements)
inside a square bracket [ ], separated by commas
42
Nested List
•
Note:
A list can also have another list as an item. This is called nested lists.
43
Accessing a list
•
List Index
A list index is the position at which any element is present in the list. Index in
the list starts from 0
•
Negative Indexing
Python allows negative indexing for its sequences. The index of -1 refers to the
last item, -2 to the second last item and so on.
44
Multiple Choice
day = ['f','r','i','d','a','y']
print(a[-1])
What will be the output of the above code ?
f
y
r
a
45
Adding elements to a list
•
We can add an element to any list using two methods :
1)
Using append()
Only one element at a time can be added to the list by using append()
method at the end of the list.
2) Using insert()
For addition of element at the desired position, insert() method is used.
3) Using extend() method
This method is used to add multiple elements at the same time at the end of
the list.
Note: extend() method won't work with a single object.
46
Append method
47
Extend method
48
Insert method
•
Python List insert() method inserts an item at a specific index in a list.
49
Multiple Choice
For addition of an element at a desired position in a list ___________ method is used.
append
extend
insert
50
Removing Elements from a List
•
Elements from a list can removed using two methods :
1) Using remove() method
Remove method in List will only remove the first occurrence of the searched
element.
2) Using pop() method
Pop() function can also be used to remove and return an element from the
set, but by default it removes only the last element of the set, to remove an
element from a specific position of the List, index of the element is passed as
an argument to the pop() method.
51
52
Multiple Choice
The remove() removes all occurances of the searched element from the list .
False
True
53
Slicing of a List
•
Slicing is done in a string to obtain sub-strings of the original string
54
Sorting
•
The sort() method by default sorts elements in ascending order.
55
Basic Python Program
•
Write a python program to accept an employee’s name and age and
display the same.
•
Write a python program to add two numbers and display the result.
•
Write a python program to accept the side of square and calculate its
area.
56
Flow of control
57
If Statement
•
The if statement is used to check a condition: if the condition is true, we run
a block of statements (called the if-block)
58
If else statement
59
Python if...elif...else Statement
60
Python Nested if
61
The For Loop
•
The for..in statement is another looping statement which iterates over a
sequence of objects i.e. go through each item in a sequence.
62
Example: Python for Loop
63
The while Statement
•
The while statement allows you to repeatedly execute a block of
statements as long as a condition is true.
64
65
CONCEPT MAP
Introduction to
python
Applications
Lists
Datatypes
Installation
Features
66
ASSIGNMENT
Q1) What are the key features of python ? Mention various applications along
with it
Q2) What are the different modes for coding in python?
Q3) What are comments in python ? List down the various types of comments.
Q4) What are the rules for naming of variables and constants
Q5) Explain python input and output with the help of an example.
Q6) Explain the insert method in list using an example.
Q7) Write the syntax of for and while loop.
Q8) What is negative indexing ? Explain with an example.
PYTHON
Show answer
Auto Play
Slide 1 / 66
SLIDE
Similar Resources on Wayground
61 questions
CO Category 2 Astronomy
Presentation
•
9th Grade
64 questions
The Eye
Presentation
•
9th Grade
60 questions
The Constitution
Presentation
•
9th - 10th Grade
61 questions
Algebra 1 Part 1 Regents June 2022
Presentation
•
9th Grade
63 questions
The Mughal Empire in India
Presentation
•
9th Grade
60 questions
Unit 6 Building Solutions Lesson A
Presentation
•
10th Grade
60 questions
WHI GRAPES Units - Politics
Presentation
•
9th Grade
61 questions
tekanan benda
Presentation
•
9th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Other
7 questions
Warm Up 04.01.2026
Quiz
•
9th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
20 questions
Linear Functions Review
Quiz
•
9th Grade
30 questions
English 1 STAAR Review
Quiz
•
9th Grade
10 questions
Pythagorean Theorem and its Converse
Quiz
•
7th - 9th Grade
14 questions
Ecological Succession: Primary and Secondary
Quiz
•
9th Grade
2 questions
APRIL 2_4F Practice
Quiz
•
9th Grade
20 questions
Grammar
Quiz
•
9th - 12th Grade