Header Ads

Python variable | comments | Syntax | Keywords | Python Tutorial for beginners #02

 Python variable | comments | Syntax | Keywords | Python Tutorial for beginners #02



Let's review the fundamentals of Python's keywords, syntax, comments, and variables. I'll also give you a Python tutorial that is appropriate for beginners.

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

No comments

Blinking TWO Led's with Arduino and Breadboard #03

Blinking TWO Led's with Arduino and Breadboard In this tutorial we will see how to turn on two Led's using Arduino Uno for beginn...

Powered by Blogger.