Python Programming – A Beginner-Friendly Guide
Python Programming – A Beginner-Friendly Guide
in Python
Presented By
Mrs.S.Geethamani
Assistant Professor
Dept. of Computer
Application
Sri Ramakrishna College of
AGENDA
Python Basics 01
https://www.google.com/search?
sca_esv=623c97b4ff62327b&rlz=1C1CHBF_enIN1131IN1131&q=Editing+Python+Files&source=lnms&fbs=AIIjpHyXkckd7Il2
1lobbVJc1XW8UWqx1w2L_HS4glko4E1W2IeeIZvHkM4DWoJRZaDIWj-19PEa5EIwXyC_8gqy8sSg0YuGujPNov0Y-
glAntJwAYWTVswxewyWawXPM03mycPjg3k2JTd-
VoWC7VEO86xToZpgRkehh7MfxzCeYMSrLn9ljsvb9NTplw0hbNyBe8_qMGzxAU85Q12Gv6oJ6qRonwIomt-
ZahucJm_0Y_IVRk7zUvc&sa=X&ved=2ahUKEwio8_Xfq5iOAxVfR2wGHaweJGAQ0pQJKAB6BAgSEAE&biw=1366&bih=641&dpr
=1
Editing Python
Files
Get In Touch With
• Reserved words (also known as keywords) are predefined and have
Us special meanings.
• They cannot be used as identifiers (e.g., variable names, function
names).
P r e s e n t e d b y: O l i v i a
Wilson
Control Flow-Blocks of code that decide
which statements to execute next based
on certain conditions.
Conditional Statement
EG PROGRAMS
marks = 80
result = ""
if marks < 30: OUT PUT:
result = "Failed"
elif marks > 75: Passed with distinction
result = "Passed with
distinction"
else:
result =
"Passed"print(result)
Loops or Iteration Statements
The continue
Statement
The for loop The while loop The break It skips the
iterates over the repeatedly executes Statement- execution of the
items of any a target statement It terminates the program block and
sequence, such as a as long as a given current loop and returns the control
list, tuple or a boolean expression resumes execution to the beginning of
string is true. at the next the current loop to
statement start the next
iteration.
EG PROGRAMS
syntax
list_name[start:stop:step
].
list loop in
python
A list loop in Python means iterating through
each element of a list so you can access or
process them.
EXAMPLE
OUTPUT OUTPUT
OUTPUT
apple Element at index 0: apple
Index: 0, Value: apple
banana Element at index 1:
Index: 1, Value: banana
cherry banana
Element at index 2: cherry Index: 2, Value: cherry
Key characteristics
• Unordered
• Unique elements
• Mutable
• Membership testing
Example
# Create a set
Program
fruits = {"apple", "banana", "cherry", "apple"} # 'apple'
repeated