Walrus operator

Walrus operator From Python 3.8, a new operator called walrus, which means sea lion, has been added to Python, which is not used much, but it helps to reduce the number of lines of code and optimize it.This operator is an assignment expression. For example, if you want to initialize a variable, you usually do […]

Making a calculator in Python in two lines with the eval function

Making a calculator in Python in two lines with the eval function The word eval is actually abbreviated to evaluate. This practical function receives a string as input, evaluates that input and returns its equivalent value. To make the calculator as simple as possible, we can use this function as follows: x = input() print(eval(x)) […]