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)

PDF
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
PPTX
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
PPTX
How to Setup Automatic Reordering Rule in Odoo 18 Inventory
Celine George
 
PPTX
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
PPTX
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
PPTX
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
PPTX
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
PPTX
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
PPTX
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
 
PDF
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
PDF
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
PDF
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
 
PPTX
Iván Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
 
PPTX
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
PDF
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
 
PDF
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
PPTX
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
PPTX
Peer Teaching Observations During School Internship
AjayaMohanty7
 
PPTX
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
PPTX
How to Manage Wins & Losses in Odoo 18 CRM
Celine George
 
Learning Styles Inventory for Senior High School Students
Thelma Villaflores
 
F-BLOCK ELEMENTS POWER POINT PRESENTATIONS
mprpgcwa2024
 
How to Setup Automatic Reordering Rule in Odoo 18 Inventory
Celine George
 
A Case of Identity A Sociological Approach Fix.pptx
Ismail868386
 
How to Create & Manage Stages in Odoo 18 Helpdesk
Celine George
 
How to Configure Taxes in Company Currency in Odoo 18 Accounting
Celine George
 
JSON, XML and Data Science introduction.pptx
Ramakrishna Reddy Bijjam
 
Elo the Hero is an story about a young boy who became hero.
TeacherEmily1
 
Project 4 PART 1 AI Assistant Vocational Education
barmanjit380
 
THE PSYCHOANALYTIC OF THE BLACK CAT BY EDGAR ALLAN POE (1).pdf
nabilahk908
 
Lesson 1 : Science and the Art of Geography Ecosystem
marvinnbustamante1
 
Supply Chain Security A Comprehensive Approach 1st Edition Arthur G. Arway
rxgnika452
 
Iván Bornacelly - Presentation of the report - Empowering the workforce in th...
EduSkills OECD
 
ESP 10 Edukasyon sa Pagpapakatao PowerPoint Lessons Quarter 1.pptx
Sir J.
 
DIGESTION OF CARBOHYDRATES ,PROTEINS AND LIPIDS
raviralanaresh2
 
Public Health For The 21st Century 1st Edition Judy Orme Jane Powell
trjnesjnqg7801
 
How to use grouped() method in Odoo 18 - Odoo Slides
Celine George
 
Peer Teaching Observations During School Internship
AjayaMohanty7
 
Martyrs of Ireland - who kept the faith of St. Patrick.pptx
Martin M Flynn
 
How to Manage Wins & Losses in Odoo 18 CRM
Celine George
 
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