Python Keywords
Python Keywords
In Python, multi-line comments are not supported using a dedicated syntax like
in some other programming languages. However, developers often use triple-
quoted strings (single or double) as a workaround to create multi-line
comments. Since these strings are not assigned to any variable, they act as
comments.
'''
This is a
multi-line comment
using triple-quotes.
'''
OR
"""
Another way to create
a multi-line comment.
"""
Integer DataType:-
In practice, integers are the most commonly used numeric type in
real-life applications. They are widely used for counting odd and even
numbers, tallying monetary values, and similar tasks. For instance, the
following code shows the addition of two integer values:
x=2+3
print(x)
# Output: 5
Decimal Type:-
Decimal numbers are an important data type in Python, with a wide
range of applications in everyday life. They are commonly used in
scientific calculations, as well as in calculations involving weights,
lengths, times, and financial transactions.
x=1.2*3.6
print(x)
# Output: 4.32
x=0.2*4
print(x)
# Output: 0.8
String Type :-
In Python, strings are a fundamental data type used to represent text.
They can contain any character that Python supports and can be
written using single quotes, double quotes, or triple quotes.
Python Keywords:-
In Python, keywords are reserved words that have special meanings and cannot
be used as identifiers (variable names, function names, etc.). These keywords
define the syntax and structure of the language. Here is a list of Python
keywords: Currently there are 36 keywords in python
These keywords serve specific purposes within the
language:
Logical Operations:
and, or, not
Control Flow:
if, else, elif, while, for, break, continue, pass,
return, yield
Exception Handling:
try, except, finally, raise
Function and Class Definitions:
def, class
Importing Modules:
import, from, as
Namespace Operations:
global, nonlocal
Boolean Values:
True, False, None