Hello Buddies 😍
I think you already installed python in your devices. Let's start our topic is variables and comments. It's a simple and easy topic. Already you know the hello world code. Before the topic start we will learn fact.
What is Syntax in Python?
For example English language have its own grammar and Telugu also have grammar but those two not same. In grammar we follow some set of instruction to build a sentence. In python we have Syntax. We need to follow some instruction to write a code.
Variables In Python
Variables is like allocating names to a data and also storing values. like containers, Pen drives etc.,
Here i created a variable (Container) name called Blog and i store a value is PythonGeeksCommunity. F5 is used to run our code. When i call Blog it will show me a output.
Rules TO Write Variables
Variables are not start with numbers and special characters. You can write starting with capital, small, and underscore like below example.
If you observer above code there is a syntax error. It means grammatical errors is there in our code. we need to solve them.
Comments
Comments are like google calendar remainders. It will remember our events. Like comments is used to understanding code better way and after some moths we opened our code. we forgot which logic applied on code. So if we used comments in our code it well helped defiantly.
Two types of Comments are there
1) Single Line Comments ( Denoted By #)
2) Multi line Comments ( Denoted By ''' ''' Or """ """ )
Nice explanation 👌.
ReplyDelete