Create dictionary in Python
In this lesson I propose a series of exercises on how to create a dictionary in Python, to learn new concepts. Create dictionary in Python – first exercise The first…
In this lesson I propose a series of exercises on how to create a dictionary in Python, to learn new concepts. Create dictionary in Python – first exercise The first…
In questa lezione studieremo il metodo get() di Python sui dizionari. Il metodo Python get() restituisce il valore della chiave specificata, se presente nel dizionario. Se la chiave non esiste…
I propose solutions to solve the algorithm that finds in Python the max number among three numbers taken as input, without using lists. As mentioned in previous lessons, there is…
In this lesson we will write a Python program to find the maximum between two numbers, in order to put into practice what we have studied so far. Python Program…
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…
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,…
In this lesson I propose some examples on the while in Python, in order to consolidate the argument on iterations. First example on the while in Python Input data 10…
In this lesson we will do some examples on the use of the while loop in Python, in order to consolidate what was explained in the last lesson. while loop…
In this lesson we will study the while loop in Python. Recall, then, that a while loop is a control structure that allows you to execute a sequence of statements,…
In this lesson we will cover some simple exercises on the Python language. Exercises Python – first exercise Take as input the hypotenuse and the cathetus of a right triangle…
In this lesson we try to implement a simple Python if example, to learn more about using conditional statements. I take three numbers as input and check if they can…
I want to develop the Chinese morra game in Python, also known as paper, scissor or rock. I had fun making this game with Scratch as well. Those who want…
In this lesson we will go through some examples of Python if statement, in order to consolidate the arguments studied so far. This Python tutorial is packed with exercises and…
In this lesson we propose some exercises on Python if statement, in order to consolidate what has been studied. First exercise on Python if statement Given in input the numerator…
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…
In this lesson we will study some functions of the Python Math module, to be able to use it in some exercises. The math module allows you to use some…
In this tutorial we will talk about how to fix errors in Python. Clearly at the beginning of programming in Python some mistakes will be made, but gradually they will…
We develop some exercises in Python in order to consolidate what we have studied so far. First exercise in Python Calculate the area of a circle by taking the radius…