Python

Nested if

In this lesson I will give examples using nested if statement in Python. Defining nestings means, in a nutshell, that you can insert ifs within other ifs or within the…

elif Python

The if elif else construct in Python allows the nesting of multiple if statements, i.e. if then otherwise statements. In fact in the Python language to implement the multiple selection,…

Python Dictionaries

Python dictionaries are data structures that contain elements (items) formed by a key (key) and a value (value). my_dict = {“key_1”: “value_1”, “key_2”: “value_2”, “key_3”: “value_3”, …} Let’s see a…

Swap Python

Given two variables we create a Python program to swap their values. In this lesson, therefore, we will implement a simple algorithm for swap variables in Python, in order to…