0% found this document useful (0 votes)
20 views14 pages

Uom 2552 What Is Python Presentation

This document provides an overview of the Python programming language through a presentation on its key concepts. It covers what Python is, how to define variables, objects, and classes in Python. It also discusses Python's common data types and operators, and how to write programs using conditionals like if/else statements and loops like for and while loops. Examples are provided for each concept to illustrate Python syntax. The document concludes with a proposed algorithm and code snippets for a sample "Jumble Word" game project in Python.

Uploaded by

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

Uom 2552 What Is Python Presentation

This document provides an overview of the Python programming language through a presentation on its key concepts. It covers what Python is, how to define variables, objects, and classes in Python. It also discusses Python's common data types and operators, and how to write programs using conditionals like if/else statements and loops like for and while loops. Examples are provided for each concept to illustrate Python syntax. The document concludes with a proposed algorithm and code snippets for a sample "Jumble Word" game project in Python.

Uploaded by

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

PRESENTATION ON : PYTHON

SUBMITTED TO: SUBMITTED BY:


Mr. VIKASH BHATNAGAR RACHIT TYAGI
Ms. PRACHI AGARWAL
TABLE OF CONTENT
1.WHAT IS PYTHON
2.VARIABLES,OBJECT ANDCLASSES
3.BASIC SYNTAX RULES
4.COMMON DATA TYPE AND OPERATORS
5.INPUT/OUTPUT
6.IF -ELSE STATEMENT
7.FOR LOOP
8.WHILE LOOP
What is Python?
● Python is a popular high-level programming language used in various applications

 Python is an easy language to learn because of its simple syntax

 Python can be used for simple tasks such as plotting or for more complex tasks like machine learning
Variables, Objects, and Classes
● A variable is a reference to a value stored in a computer’s memory.
● Variables can be sorted into a variety of categories (or data types) such as numbers (int/float etc),
Boolean values (true/false), and sequences (strings, lists etc).
● An object is a collection of data from a computer’s memory.

 ALL VARIABLES ARE OBJECTS although some objects can be defined by data
referred to by multiple variables.
 Methods are the functions used to act on/alter an object’s data. They describe
what your object can “do.”
Variables, Objects, and Classes (cont.)
● A class is a collection of objects who share
the same set of variables/methods.

 The definition of the class provides a Instance #1


blueprint for all the objects within it Color: Pink
(instances).
Name: Polo
 Instances may share the same variables Instance #2
(color, size, shape, etc.), but they do NOT Color: Red
share the same values for each variable Name: Mini
(blue/red/pink, small/large, square/circular
etc.) Instance #3
Color: Blue
Name: Beetle
Common Data Types and Operators
● A data type is a means of classifying a value and determining what operations
can be performed on it. All objects have a data type.
● Operators are symbols used carry out specific functions/computations.
● https://www.youtube.com/watch?v=v5MR5JnKcZI
If-else Statements
● If-else statements allow programmers to adapt the function of their
code based on a given condition.
● If a given condition (i.e. x % 2 == 0) is true, then the statements
following the if statement (if) will be executed. If the condition is false,
the statements following the else statement (else) will be executed.
xString = input(“Enter a
 The condition is tested using the Boolean operators == (is equal number: “)
to), != (is not equal to), and (used to test multiple conditions), and
or (used to test if AT LEAST ONE condition is true). x = int(xString)
if x % 2 == 0:
 Additionally, else-if statements (elif) can be used to provide
unique coding statements for multiple conditions. print(“This is an even
number”)
elif x == 0:
print(“This number equals
0”)
else:
print(“This is an odd
For Loops
● For loops perform the same task (iterate) for the number of
times specified by an iterable (something that can be evaluated
repeatedly such as a list, string, or range).
● for defines the for loop
● x is the variable defining the number of times the statements
within the loop (print(myInt)) are executed.
● The range(start, stop, step) function is often used to define x. myString = input(“Enter a number
 The starting value is defined by start, the final value is
myInt = int(myString)
defined by stop – 1, and the magnitude at which x
changes between loops is defined by step.
● in is a Boolean operator that returns true if the given value (x) is for x in range(0, 5, 1): print(myInt
found within a given list, string, range etc.
While Loops myString = input(“Enter a
● While loops are statements that iterate so long as a given number: “)
Boolean condition is met. myInt = int(myString)
 x (the variable determining whether or not the x=0
condition is met) is defined and manipulated while x < 5:
OUTSIDE of the header of the while loop (while)
print(myInt)
 The condition (x < 5) is a statement containing a
Boolean variable.
x= x +1
 break is a statement used to exit the current
for/while loop.

 continue is a statement used to reject all


statements in the current for/while loop iteration
and return to the beginning of the loop.
PROJECT
JUMBLE WORD
PROPOSED ALGORITHM
• RUN THE PROGRAM
• ENTER YOUR GUSSE FROM JUMBLE WORD
• CHECK THE RESULT
• PLAY AGAIN AND CLOSE
SNAPSHOT OF SOURCE CODE
OUTPUT
THANK YOU

You might also like