SlideShare a Scribd company logo
1 of 11
Comments
• Python has commenting capability for the purpose of
in-code documentation.
• Comments start with a #, and Python will render the
rest of the line as a comment:
Example:-
Comments in Python:
#This is a comment.
print("Hello, World!")
Python Comments
• Comments can be used to explain Python code.
• Comments can be used to make the code more
readable.
• Comments can be used to prevent execution when
testing code.
Creating a Comment
Comments starts with a #, and Python will ignore them:
Example
#This is a comment
print("Hello, World!")
Comments can be placed at the end of a line, and Python
will ignore the rest of the line:
print("Hello, World!") #This is a comment
A comment does not have to be text that explains the
code, it can also be used to prevent Python from
executing code:
Example
#print("Hello, World!")
print("Cheers, Mate!")
Multiline Comments
Python does not really have a syntax for multiline comments.
To add a multiline comment you could insert a # for each line:
Example
#This is a comment
#written in
#more than just one line
print("Hello, World!")
• Or, not quite as intended, you can use a multiline string.
• Since Python will ignore string literals that are not
assigned to a variable, you can add a multiline string
(triple quotes) in your code, and place your comment
inside it:
Example:-
"""
This is a comment
written in
more than just one line
"""
print("Hello, World!")
As long as the string is not assigned to a variable, Python will read the code, but then
ignore it, and you have made a multiline comment.
Input/Output Functions in Python
INTRODUCTION
•Input Function (input()):
• Allows user input during program execution.
• Returns the entered data as a string.
•Output Function (print()):
• Displays information to the console.
• Can print strings, variables, and expressions.
Input Function Example
pythonCopy code
user_input = input("Enter something: ")
•Waits for user input.
•Captures the input as a string in the variable user_input.
Output Function Example
pythonCopy code
print("You entered:", user_input)
•Displays the message along with the user's input.
Combining Input and Output
pythonCopy code
name = input("Enter your name: ") age = input("Enter your
age: ") print("Hello,", name + "!") print("You are", age,
"years old.")
•Collects user's name and age.
•Outputs a personalized greeting and age information.
Conclusion
•Input and output functions are essential for user
interaction and displaying results in Python.
•Understanding these functions is crucial for building
interactive and user-friendly programs.
Thank you

More Related Content

Similar to pythoncommentsandvariables-231016105804-9a780b91 (1).pptx

Python_Interview_Questions_And_Answers..
Python_Interview_Questions_And_Answers..Python_Interview_Questions_And_Answers..
Python_Interview_Questions_And_Answers..GajulaYuvaraj
 
Python Fundamentals for the begginers in programming
Python Fundamentals for the begginers in programmingPython Fundamentals for the begginers in programming
Python Fundamentals for the begginers in programmingbsse20142018
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of pythonBijuAugustian
 
Python programming msc(cs)
Python programming msc(cs)Python programming msc(cs)
Python programming msc(cs)KALAISELVI P
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scriptingAmirul Shafeeq
 
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxansariparveen06
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHBhavsingh Maloth
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxcigogag569
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptxMohammedAlYemeni1
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptxMaheShiva
 
Notes1
Notes1Notes1
Notes1hccit
 
1.3 Basic coding skills_tupels_sets_controlloops.ppt
1.3 Basic coding skills_tupels_sets_controlloops.ppt1.3 Basic coding skills_tupels_sets_controlloops.ppt
1.3 Basic coding skills_tupels_sets_controlloops.pptVGaneshKarthikeyan
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsAndrew McNicol
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1Kirti Verma
 

Similar to pythoncommentsandvariables-231016105804-9a780b91 (1).pptx (20)

Python_Interview_Questions_And_Answers..
Python_Interview_Questions_And_Answers..Python_Interview_Questions_And_Answers..
Python_Interview_Questions_And_Answers..
 
gdscpython.pdf
gdscpython.pdfgdscpython.pdf
gdscpython.pdf
 
Python Fundamentals for the begginers in programming
Python Fundamentals for the begginers in programmingPython Fundamentals for the begginers in programming
Python Fundamentals for the begginers in programming
 
Fundamentals of python
Fundamentals of pythonFundamentals of python
Fundamentals of python
 
Python programming msc(cs)
Python programming msc(cs)Python programming msc(cs)
Python programming msc(cs)
 
introduction to server-side scripting
introduction to server-side scriptingintroduction to server-side scripting
introduction to server-side scripting
 
Python Programming Course in janak puri, New Delhi
Python Programming Course in janak puri, New DelhiPython Programming Course in janak puri, New Delhi
Python Programming Course in janak puri, New Delhi
 
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
 
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTHWEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
WEB PROGRAMMING UNIT VIII BY BHAVSINGH MALOTH
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
python-ppt.ppt
python-ppt.pptpython-ppt.ppt
python-ppt.ppt
 
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptxa9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
a9855c3532e13484ee6a39ba30218896d7c0d863-1676987272842.pptx
 
Lecture1_introduction to python.pptx
Lecture1_introduction to python.pptxLecture1_introduction to python.pptx
Lecture1_introduction to python.pptx
 
PYTHON FEATURES.pptx
PYTHON FEATURES.pptxPYTHON FEATURES.pptx
PYTHON FEATURES.pptx
 
Notes1
Notes1Notes1
Notes1
 
Python Introduction
Python IntroductionPython Introduction
Python Introduction
 
1.3 Basic coding skills_tupels_sets_controlloops.ppt
1.3 Basic coding skills_tupels_sets_controlloops.ppt1.3 Basic coding skills_tupels_sets_controlloops.ppt
1.3 Basic coding skills_tupels_sets_controlloops.ppt
 
Python component in mule
Python component in mulePython component in mule
Python component in mule
 
Introduction to Python for Security Professionals
Introduction to Python for Security ProfessionalsIntroduction to Python for Security Professionals
Introduction to Python for Security Professionals
 
Python final presentation kirti ppt1
Python final presentation kirti ppt1Python final presentation kirti ppt1
Python final presentation kirti ppt1
 

More from MalligaarjunanN

English article power point presentation eng.pptx
English article power point presentation eng.pptxEnglish article power point presentation eng.pptx
English article power point presentation eng.pptxMalligaarjunanN
 
Digital principle and computer design Presentation (1).pptx
Digital principle and computer design Presentation (1).pptxDigital principle and computer design Presentation (1).pptx
Digital principle and computer design Presentation (1).pptxMalligaarjunanN
 
Technical English grammar and tenses.pptx
Technical English grammar and tenses.pptxTechnical English grammar and tenses.pptx
Technical English grammar and tenses.pptxMalligaarjunanN
 
Polymorphism topic power point presentation li.pptx
Polymorphism topic power point presentation li.pptxPolymorphism topic power point presentation li.pptx
Polymorphism topic power point presentation li.pptxMalligaarjunanN
 
Chemistry iconic bond topic chem ppt.pptx
Chemistry iconic bond topic chem ppt.pptxChemistry iconic bond topic chem ppt.pptx
Chemistry iconic bond topic chem ppt.pptxMalligaarjunanN
 
C programming DOC-20230723-WA0001..pptx
C programming  DOC-20230723-WA0001..pptxC programming  DOC-20230723-WA0001..pptx
C programming DOC-20230723-WA0001..pptxMalligaarjunanN
 
Chemistry fluorescent topic chemistry.pptx
Chemistry fluorescent topic  chemistry.pptxChemistry fluorescent topic  chemistry.pptx
Chemistry fluorescent topic chemistry.pptxMalligaarjunanN
 
C programming power point presentation c ppt.pptx
C programming power point presentation c ppt.pptxC programming power point presentation c ppt.pptx
C programming power point presentation c ppt.pptxMalligaarjunanN
 
Inheritance_Polymorphism_Overloading_overriding.pptx
Inheritance_Polymorphism_Overloading_overriding.pptxInheritance_Polymorphism_Overloading_overriding.pptx
Inheritance_Polymorphism_Overloading_overriding.pptxMalligaarjunanN
 
Python programming file handling mhhk.pptx
Python programming file handling mhhk.pptxPython programming file handling mhhk.pptx
Python programming file handling mhhk.pptxMalligaarjunanN
 
Computer organisation and architecture updated unit 2 COA ppt.pptx
Computer organisation and architecture updated unit 2 COA ppt.pptxComputer organisation and architecture updated unit 2 COA ppt.pptx
Computer organisation and architecture updated unit 2 COA ppt.pptxMalligaarjunanN
 
Data structures trees and graphs - Heap Tree.pptx
Data structures trees and graphs - Heap Tree.pptxData structures trees and graphs - Heap Tree.pptx
Data structures trees and graphs - Heap Tree.pptxMalligaarjunanN
 
Data structures trees and graphs - AVL tree.pptx
Data structures trees and graphs - AVL  tree.pptxData structures trees and graphs - AVL  tree.pptx
Data structures trees and graphs - AVL tree.pptxMalligaarjunanN
 
Data structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptxData structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptxMalligaarjunanN
 
Computer organisation and architecture .
Computer organisation and architecture .Computer organisation and architecture .
Computer organisation and architecture .MalligaarjunanN
 
Python programming variables and comment
Python programming variables and commentPython programming variables and comment
Python programming variables and commentMalligaarjunanN
 
Python programming - Functions and list and tuples
Python programming - Functions and list and tuplesPython programming - Functions and list and tuples
Python programming - Functions and list and tuplesMalligaarjunanN
 
presentation-130909130658- (1).pdf
presentation-130909130658- (1).pdfpresentation-130909130658- (1).pdf
presentation-130909130658- (1).pdfMalligaarjunanN
 

More from MalligaarjunanN (20)

English article power point presentation eng.pptx
English article power point presentation eng.pptxEnglish article power point presentation eng.pptx
English article power point presentation eng.pptx
 
Digital principle and computer design Presentation (1).pptx
Digital principle and computer design Presentation (1).pptxDigital principle and computer design Presentation (1).pptx
Digital principle and computer design Presentation (1).pptx
 
Technical English grammar and tenses.pptx
Technical English grammar and tenses.pptxTechnical English grammar and tenses.pptx
Technical English grammar and tenses.pptx
 
Polymorphism topic power point presentation li.pptx
Polymorphism topic power point presentation li.pptxPolymorphism topic power point presentation li.pptx
Polymorphism topic power point presentation li.pptx
 
Chemistry iconic bond topic chem ppt.pptx
Chemistry iconic bond topic chem ppt.pptxChemistry iconic bond topic chem ppt.pptx
Chemistry iconic bond topic chem ppt.pptx
 
C programming DOC-20230723-WA0001..pptx
C programming  DOC-20230723-WA0001..pptxC programming  DOC-20230723-WA0001..pptx
C programming DOC-20230723-WA0001..pptx
 
Chemistry fluorescent topic chemistry.pptx
Chemistry fluorescent topic  chemistry.pptxChemistry fluorescent topic  chemistry.pptx
Chemistry fluorescent topic chemistry.pptx
 
C programming power point presentation c ppt.pptx
C programming power point presentation c ppt.pptxC programming power point presentation c ppt.pptx
C programming power point presentation c ppt.pptx
 
Inheritance_Polymorphism_Overloading_overriding.pptx
Inheritance_Polymorphism_Overloading_overriding.pptxInheritance_Polymorphism_Overloading_overriding.pptx
Inheritance_Polymorphism_Overloading_overriding.pptx
 
Python programming file handling mhhk.pptx
Python programming file handling mhhk.pptxPython programming file handling mhhk.pptx
Python programming file handling mhhk.pptx
 
Computer organisation and architecture updated unit 2 COA ppt.pptx
Computer organisation and architecture updated unit 2 COA ppt.pptxComputer organisation and architecture updated unit 2 COA ppt.pptx
Computer organisation and architecture updated unit 2 COA ppt.pptx
 
Data structures trees and graphs - Heap Tree.pptx
Data structures trees and graphs - Heap Tree.pptxData structures trees and graphs - Heap Tree.pptx
Data structures trees and graphs - Heap Tree.pptx
 
Data structures trees and graphs - AVL tree.pptx
Data structures trees and graphs - AVL  tree.pptxData structures trees and graphs - AVL  tree.pptx
Data structures trees and graphs - AVL tree.pptx
 
Data structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptxData structures trees - B Tree & B+Tree.pptx
Data structures trees - B Tree & B+Tree.pptx
 
Computer organisation and architecture .
Computer organisation and architecture .Computer organisation and architecture .
Computer organisation and architecture .
 
Python programming variables and comment
Python programming variables and commentPython programming variables and comment
Python programming variables and comment
 
Python programming - Functions and list and tuples
Python programming - Functions and list and tuplesPython programming - Functions and list and tuples
Python programming - Functions and list and tuples
 
X02PredCalculus.ppt
X02PredCalculus.pptX02PredCalculus.ppt
X02PredCalculus.ppt
 
presentation-130909130658- (1).pdf
presentation-130909130658- (1).pdfpresentation-130909130658- (1).pdf
presentation-130909130658- (1).pdf
 
Presentation (5)-1.pptx
Presentation (5)-1.pptxPresentation (5)-1.pptx
Presentation (5)-1.pptx
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutionsmonugehlot87
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
buds n tech IT solutions
buds n  tech IT                solutionsbuds n  tech IT                solutions
buds n tech IT solutions
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 

pythoncommentsandvariables-231016105804-9a780b91 (1).pptx

  • 1. Comments • Python has commenting capability for the purpose of in-code documentation. • Comments start with a #, and Python will render the rest of the line as a comment: Example:- Comments in Python: #This is a comment. print("Hello, World!")
  • 2. Python Comments • Comments can be used to explain Python code. • Comments can be used to make the code more readable. • Comments can be used to prevent execution when testing code.
  • 3. Creating a Comment Comments starts with a #, and Python will ignore them: Example #This is a comment print("Hello, World!") Comments can be placed at the end of a line, and Python will ignore the rest of the line: print("Hello, World!") #This is a comment
  • 4. A comment does not have to be text that explains the code, it can also be used to prevent Python from executing code: Example #print("Hello, World!") print("Cheers, Mate!")
  • 5. Multiline Comments Python does not really have a syntax for multiline comments. To add a multiline comment you could insert a # for each line: Example #This is a comment #written in #more than just one line print("Hello, World!")
  • 6. • Or, not quite as intended, you can use a multiline string. • Since Python will ignore string literals that are not assigned to a variable, you can add a multiline string (triple quotes) in your code, and place your comment inside it: Example:- """ This is a comment written in more than just one line """ print("Hello, World!") As long as the string is not assigned to a variable, Python will read the code, but then ignore it, and you have made a multiline comment.
  • 7. Input/Output Functions in Python INTRODUCTION •Input Function (input()): • Allows user input during program execution. • Returns the entered data as a string. •Output Function (print()): • Displays information to the console. • Can print strings, variables, and expressions.
  • 8. Input Function Example pythonCopy code user_input = input("Enter something: ") •Waits for user input. •Captures the input as a string in the variable user_input. Output Function Example pythonCopy code print("You entered:", user_input) •Displays the message along with the user's input.
  • 9. Combining Input and Output pythonCopy code name = input("Enter your name: ") age = input("Enter your age: ") print("Hello,", name + "!") print("You are", age, "years old.") •Collects user's name and age. •Outputs a personalized greeting and age information.
  • 10. Conclusion •Input and output functions are essential for user interaction and displaying results in Python. •Understanding these functions is crucial for building interactive and user-friendly programs.