Python programming [Part -03] :: Python Comment.

in #busy6 years ago

Python-Training.png

Today I have come back again in the
midst of you . With only your thoughts on the subject alone,
we will further clarify the issues. The
topic that we will discuss today is the
Python comment. What is it, why use,
how to
Python Comment: When you
write a program , you will remember it

Where did you write? But if you ever
need to edit the program, then you
may not have all thought. And to remember
these are the Python comments. Python
comments are
written before any statement or program , its nature, work, etc. The
rule of writing is to
use a # symbol before writing the line . If there are # signs, Python
will not regard it as a program or will not
touch it. If the example below is
more clear:

1 # This program will calculate the area of ​​a rectangle
2 print ("Do you want to calculate a rectangle's area? Input that length and width of rectangle in numbers")
3 length = float (input ("Enter the length:")
4 width = float (input ("enter the width:"))
5 print ("area =", length * width))
6 input ("please give your feedback:")

Run the program # The next
part of the # sign is useful Did not By this I just
mean what kind of program is And that's just for
me. Not for people who use the program
. See #date appears in the next section
.
With this program, we
find out the area of a rectangle . After the comment, we
print the user through the print that
you
can find out the area of a rectangle through the program
. If you want to do this
, input the number below to the correct data.
Then we
have input from the user with two variables called length, width .
Then we multiplied our area, its area.
You can
also write the program as you want below :

1 # This program will calculate the area of ​​a rectangle
2 print ("Do you want to calculate a rectangle's area? Input that length and width of rectangle in numbers")
3 length = float (input ("Enter the length:")
4 width = float (input ("enter the width:"))
5 a = length * width
6 print ("area =", a))
7 input ("please give your feedback: ")

Here I
multiplied a new variable with a name and then
printed that variable .
I
wrote a very small program for you:
1 # This program converts Fahrenheit to Celsius
2 fahr_temp = float (input ("Fahrenheit temperature:")
3 print ("Celsius temperature:", (fahr_temp - 32.0) * 5.0 / 9.0)

Another such program:
1 # This program calculates rate and distance problems
2 print ("Input a rate and a distance")
3 rate = float (input ("rate:")
4 distance = float (input ("Distance : "))

Try to understand the 5 print (" Time: ", (distance / rate) programs, and
manually create more such programs manually
. If you do not understand, tell in the comments.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Sort:  

Congratulations! This post has been upvoted from the communal account, @minnowsupport, by Reja83 from the Minnow Support Project. It's a witness project run by aggroed, ausbitbank, teamsteem, theprophet0, someguy123, neoxian, followbtcnews, and netuoso. The goal is to help Steemit grow by supporting Minnows. Please find us at the Peace, Abundance, and Liberty Network (PALnet) Discord Channel. It's a completely public and open space to all members of the Steemit community who voluntarily choose to be there.

If you would like to delegate to the Minnow Support Project you can do so by clicking on the following links: 50SP, 100SP, 250SP, 500SP, 1000SP, 5000SP.
Be sure to leave at least 50SP undelegated on your account.

Coin Marketplace

STEEM 0.28
TRX 0.12
JST 0.033
BTC 69747.29
ETH 3747.51
USDT 1.00
SBD 3.78