SlideShare a Scribd company logo
PYTHON PROGRAMMING
This presentation contains the
concepts related to Basic coding
skills
Basic Coding Skills
• Python programming relies on proper indentation
• Case sensitive
• Standard indentation is four spaces
• Implicit continuation (use four spaces in the
continuation line)
print ("Sum = ", str(10+20)
+ "Diff = ", str(20-10))
• Explicit continuation (it is not recommended)
print ("Sum = ", str(10+20) 
+ "Diff = ", str(20-10))
2
Basic Coding Skills
• A program typically starts with a shebang line that
begins with a hash (#) symbol followed by a bang (!)
symbol. (identifies the interpreter when running the
program).
• If you're using IDLE to run your programs, you don't
need a shebang line.
• However, it's generally considered a good practice to
include one.
3
Comments
• Comments can be used to disable statements that you
don't want to run when you compile and run a program.
• Comments starts with a #, and Python will ignore them.
• Two types
– Block comments
– Inline comments
• Guidelines for using comments
– Use comments
• to describe portions of code that are hard to understand, but
don't overdo them.
• to comment out statements that you don't want to test.
– If you change the code that's described by comments,
change the comments too.
4
Comments
5
Comments
• Python does not really have a syntax for multi line comments.
• To add a multiline comment you could insert a # for each line.
• For writing “proper” multi-line comments in Python is to use
multi-line strings with the """ syntax in creative ways. Here’s an
example:
"""
This is a "block comment" in Python, made
out of a mult-line string constant.
This actually works quite well!
""“
• However, be careful where you place these “comments” in the
code. If the string follows right after a function signature, a
class definition, or at the start of a module, it turns into a
docstring which has a different meaning altogether in Python:
6
How to use functions ?
• A function is a reusable unit of code that performs a
specific task.
• Many built-in functions (in Python) that do common
tasks like getting input, printing output and etc.
• When you call a function, you code the name of the
function followed by a pair of parentheses. Within
the parentheses, you code any arguments that the
function requires, and you separate multiple
arguments with commas.
7
How to use functions ? – print()
8
How to use functions ? – input()
• The input() function allows a user to insert a value
into a program.
• input() returns a string value. You can convert the
contents of an input using any data type.
• For instance, you can convert the value a user inserts
to a floating-point number.
• For example:
x=input("Enter your name")
print("Welcome to Python Programming ", x)
I/P: III Year Students
O/P: Welcome to Python Programming III Year Students
9

More Related Content

Similar to Basic coding skills_python and its applications (20)

PDF
Python: An introduction A summer workshop
ForrayFerenc
 
PDF
Introduction To Programming with Python
Sushant Mane
 
PPTX
Python_Modullllllle_2-_AFV._Funda-1.pptx
tissot723
 
PDF
Lecture 0 - CS50's Introduction to Programming with Python.pdf
SrinivasPonugupaty1
 
PPTX
Python_Interview_Questions_And_Answers..
GajulaYuvaraj
 
PPTX
Lecture Introduction to Python 2024.pptx
fgbcssarl
 
PPTX
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
 
PPTX
Python basics
Hoang Nguyen
 
PPTX
Python basics
Luis Goldster
 
PPTX
Python basics
Tony Nguyen
 
PPTX
Python basics
Fraboni Ec
 
PPTX
Python basics
Harry Potter
 
PPTX
Python basics
Young Alista
 
PPTX
Python basics
James Wong
 
PDF
Pythonintro
Hardik Malhotra
 
PPTX
Python
Dr. SURBHI SAROHA
 
PPTX
Chapter7-Introduction to Python.pptx
lemonchoos
 
PPTX
introduction to python
Jincy Nelson
 
PPTX
20BCT23 – PYTHON PROGRAMMING.pptx
gokilabrindha
 
PPTX
Python ppt
GoogleDeveloperStude2
 
Python: An introduction A summer workshop
ForrayFerenc
 
Introduction To Programming with Python
Sushant Mane
 
Python_Modullllllle_2-_AFV._Funda-1.pptx
tissot723
 
Lecture 0 - CS50's Introduction to Programming with Python.pdf
SrinivasPonugupaty1
 
Python_Interview_Questions_And_Answers..
GajulaYuvaraj
 
Lecture Introduction to Python 2024.pptx
fgbcssarl
 
BASICS OF PYTHON usefull for the student who would like to learn on their own
Nandini485510
 
Python basics
Hoang Nguyen
 
Python basics
Luis Goldster
 
Python basics
Tony Nguyen
 
Python basics
Fraboni Ec
 
Python basics
Harry Potter
 
Python basics
Young Alista
 
Python basics
James Wong
 
Pythonintro
Hardik Malhotra
 
Chapter7-Introduction to Python.pptx
lemonchoos
 
introduction to python
Jincy Nelson
 
20BCT23 – PYTHON PROGRAMMING.pptx
gokilabrindha
 

More from ganeshkarthy (15)

PPT
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
PPTX
Lecture-5-Linear Regression-Tutorials.PPTX
ganeshkarthy
 
PPTX
Lecture-5-Linear Regression-Tutorials.PPTX
ganeshkarthy
 
PPTX
Lecture-6-Linear Regression-Gradient Descent-Tutorials.PPTX
ganeshkarthy
 
PPTX
3Arrays, Declarations, Expressions, Statements, Symbolic constant.pptx
ganeshkarthy
 
PPT
C_Language_PS&PC_Notes.ppt
ganeshkarthy
 
PDF
CLOUD_COMPUTING_UNIT_2.pdf
ganeshkarthy
 
PDF
CLOUD_COMPUTING_UNIT_1.pdf
ganeshkarthy
 
PPTX
S16_Notes_CC.pptx
ganeshkarthy
 
PPTX
Asynchronous Frameworks.pptx
ganeshkarthy
 
PPT
Green computing PPT Notes.ppt
ganeshkarthy
 
PPT
OOPS(CS8392)_Unit-I_Notes.ppt
ganeshkarthy
 
PPT
Unit-II(STATIC UML DIAGRAMS).ppt
ganeshkarthy
 
DOCX
UNIT-I(Unified_Process_and_Use Case_Diagrams)_OOAD.docx
ganeshkarthy
 
PDF
Unit-1_Notes(OOAD).pdf
ganeshkarthy
 
Java ppt-class_basic data types methods definitions
ganeshkarthy
 
Lecture-5-Linear Regression-Tutorials.PPTX
ganeshkarthy
 
Lecture-5-Linear Regression-Tutorials.PPTX
ganeshkarthy
 
Lecture-6-Linear Regression-Gradient Descent-Tutorials.PPTX
ganeshkarthy
 
3Arrays, Declarations, Expressions, Statements, Symbolic constant.pptx
ganeshkarthy
 
C_Language_PS&PC_Notes.ppt
ganeshkarthy
 
CLOUD_COMPUTING_UNIT_2.pdf
ganeshkarthy
 
CLOUD_COMPUTING_UNIT_1.pdf
ganeshkarthy
 
S16_Notes_CC.pptx
ganeshkarthy
 
Asynchronous Frameworks.pptx
ganeshkarthy
 
Green computing PPT Notes.ppt
ganeshkarthy
 
OOPS(CS8392)_Unit-I_Notes.ppt
ganeshkarthy
 
Unit-II(STATIC UML DIAGRAMS).ppt
ganeshkarthy
 
UNIT-I(Unified_Process_and_Use Case_Diagrams)_OOAD.docx
ganeshkarthy
 
Unit-1_Notes(OOAD).pdf
ganeshkarthy
 
Ad

Recently uploaded (20)

PPTX
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Horarios de distribución de agua en julio
pegazohn1978
 
PDF
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
PDF
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
PDF
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
PDF
Introduction presentation of the patentbutler tool
MIPLM
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
PPTX
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
TRANSLATIONAL AND ROTATIONAL MOTION.pptx
KIPAIZAGABAWA1
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
grade 5 lesson matatag ENGLISH 5_Q1_PPT_WEEK4.pptx
SireQuinn
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Horarios de distribución de agua en julio
pegazohn1978
 
Android Programming - Basics of Mobile App, App tools and Android Basics
Kavitha P.V
 
Is Assignment Help Legal in Australia_.pdf
thomas19williams83
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
Women's Health: Essential Tips for Every Stage.pdf
Iftikhar Ahmed
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
DAY 1_QUARTER1 ENGLISH 5 WEEK- PRESENTATION.pptx
BanyMacalintal
 
Stokey: A Jewish Village by Rachel Kolsky
History of Stoke Newington
 
Introduction presentation of the patentbutler tool
MIPLM
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
How to Send Email From Odoo 18 Website - Odoo Slides
Celine George
 
HUMAN RESOURCE MANAGEMENT: RECRUITMENT, SELECTION, PLACEMENT, DEPLOYMENT, TRA...
PRADEEP ABOTHU
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
STATEMENT-BY-THE-HON.-MINISTER-FOR-HEALTH-ON-THE-COVID-19-OUTBREAK-AT-UG_revi...
nservice241
 
Ad

Basic coding skills_python and its applications

  • 1. PYTHON PROGRAMMING This presentation contains the concepts related to Basic coding skills
  • 2. Basic Coding Skills • Python programming relies on proper indentation • Case sensitive • Standard indentation is four spaces • Implicit continuation (use four spaces in the continuation line) print ("Sum = ", str(10+20) + "Diff = ", str(20-10)) • Explicit continuation (it is not recommended) print ("Sum = ", str(10+20) + "Diff = ", str(20-10)) 2
  • 3. Basic Coding Skills • A program typically starts with a shebang line that begins with a hash (#) symbol followed by a bang (!) symbol. (identifies the interpreter when running the program). • If you're using IDLE to run your programs, you don't need a shebang line. • However, it's generally considered a good practice to include one. 3
  • 4. Comments • Comments can be used to disable statements that you don't want to run when you compile and run a program. • Comments starts with a #, and Python will ignore them. • Two types – Block comments – Inline comments • Guidelines for using comments – Use comments • to describe portions of code that are hard to understand, but don't overdo them. • to comment out statements that you don't want to test. – If you change the code that's described by comments, change the comments too. 4
  • 6. Comments • Python does not really have a syntax for multi line comments. • To add a multiline comment you could insert a # for each line. • For writing “proper” multi-line comments in Python is to use multi-line strings with the """ syntax in creative ways. Here’s an example: """ This is a "block comment" in Python, made out of a mult-line string constant. This actually works quite well! ""“ • However, be careful where you place these “comments” in the code. If the string follows right after a function signature, a class definition, or at the start of a module, it turns into a docstring which has a different meaning altogether in Python: 6
  • 7. How to use functions ? • A function is a reusable unit of code that performs a specific task. • Many built-in functions (in Python) that do common tasks like getting input, printing output and etc. • When you call a function, you code the name of the function followed by a pair of parentheses. Within the parentheses, you code any arguments that the function requires, and you separate multiple arguments with commas. 7
  • 8. How to use functions ? – print() 8
  • 9. How to use functions ? – input() • The input() function allows a user to insert a value into a program. • input() returns a string value. You can convert the contents of an input using any data type. • For instance, you can convert the value a user inserts to a floating-point number. • For example: x=input("Enter your name") print("Welcome to Python Programming ", x) I/P: III Year Students O/P: Welcome to Python Programming III Year Students 9