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 »

Python Hello World Program

If you landed here, I am assuming you heard about Python programming and want to learn it. Well, that’s great. And the first step in learning any new programming language is to write the infamous Hello World program. Let’s write our first Python program to print “Hello World” on the console. Let’s first get to …

Python Hello World Program Read More »