Python variable | comments | Syntax | Keywords | Python Tutorial for beginners #02
Python variable | comments | Syntax | Keywords | Python Tutorial for beginners #02
Variables in Python:
In Python, variables are used to store data values. You can assign a value to a variable using the assignment operator (=). Here's an example:
example:
x = 5;
here x is an variable,
Comments in Python:
Remarks are utilized to add logical notes or to incapacitate specific lines of code. They are not executed by the Python translator. In Python, remarks start with the hash character (#). Here is a model:
Single line comment:
Ex: X= 5 # single line comment will be defined by #
Multiline Comment:
Ex : y = """ Python is an very easy language
easy to lean and easy to understand"""
Syntax in Python:
Python has a sentence structure that characterizes the guidelines for composing substantial Python programs. Legitimate space is pivotal in Python as showing the construction of the code is utilized. Blocks of code are characterized by their space level. For instance:
Ex:
if y > 0:
print("even")
else:
print("odd")
The colon (:) is utilized to show the beginning of an indented block of code.
Keywords in Python:
Catchphrases are saved words that have a particular significance in the Python language. They can't be utilized as factor names. Here are a few instances of Python catchphrases:
Keywords are below:
also, or, not, if, else, while, for, break, proceed, def, class, import, from, return, Valid, Misleading, None
For More Details : Contact : info@infysky.com
Post a Comment