Tag Archives: Python

Python – Try/Except

By | 20/01/2021

In this post, we will see how to manage Try/Except in Python. Just to remember what try/except is: Try/Except is a statement marks a block of statements to try and specifies a response should an exception be thrown.In detail, in Try/Except we have three blocks:Try,  used to test a block of code for errors.Except, used… Read More »

Python – Eval

By | 04/08/2020

In this post, we will see what Eval() is and how we can use it. We start creating a function that returns true if a given inequality expression is correct and false otherwise. Examples: test_signs(“3 < 7 <11”) return Truetest_signs(“13 > 44 > 33 > 1”) return Falsetest_signs(“1 < 2 < 6 < 9 >… Read More »

Python – Challenge: FizzBuzz

By | 28/07/2020

In this post, we will see how to resolve FizzBuzz using Python.We will create a function that takes a number as input and it will return “Fizz“, “Buzz” or “FizzBuzz“.The rules are: If the number is a multiple of 3 the output should be “Fizz”. If the number is a multiple of 5, the output should… Read More »

Python – How to create a RESTful service

By | 14/01/2020

In this post, we will see how to create a RESTful service for handling data of some Dogs, with Python and Flask. First of all, what Flask is?From Wikipedia:“Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries.It has no database abstraction layer, form validation, or any… Read More »

Python – Set

By | 30/09/2019

Set is an unordered collection of comma separated elements inside curly braces. The order of element is undefined and it is possible to add and delete elements and, it is possible to perform standard operations on sets like union, intersection and difference.In this post, we will see how to manage Set in Python. CREATE ADD… Read More »