Pankaj Kumar

I have been working on Python programming for more than 12 years. At AskPython, I share my learning on Python with other fellow developers.

Python Functions

Functions in Python is a block of code with a name. We can call a function by its name and the code inside the function block will be executed. We can’t use reserved keywords as the function name. A function name must follow the Python identifiers definition rules. Function Parameters We can pass some data

Python Functions Read More »

Python Operators

Operators in Python are used to perform a specific operation on variables and values. Python has a lot of operators that are either keywords or special characters. The values or variables on which these operators work are called operands. Types of Python Operators Python operators can be classified into the following categories. Arithmetic Operators Logical

Python Operators Read More »

Python Data Types

Python is an object-oriented programming language. Every variable in Python is an instance of some class. There are many pre-defined Python data types. We can create our own classes to define custom data types in Python. What are the Popular Data Types in Python? Some of the popular data types in Python are: Numbers –

Python Data Types Read More »

Python Docstring

Python Docstring (Document String) is a string literal that is the first statement in a module, function, class, or method. How to Write a Python Docstring? Python docstring is surrounded by a pair of triple double-quotes (“””). Let’s look at some examples of writing docstrings in Python. 1. Python Function Docstring Example 2. Python Class

Python Docstring Read More »

Python Variables

Variables in Python are an identifier to reference a value in the program. A variable contains the memory location of the object. They allow python programs to access other objects and call their functions or perform other operations. Rules to Define a Variable in Python There are a few rules to define a python variable.

Python Variables Read More »

Python Keywords

Python keywords are reserved words. They are used by python interpreters to understand the program. Keywords define the structure of programs. We can’t use keywords to name program entities such as variables, classes, and functions. How Many Keywords in Python? Python has a lot of keywords. The number keeps on growing with the new features

Python Keywords Read More »