Hola todos !

Today we are going to learn how to code a calculator program with some specific conditions to avoid input errors and asking to restart the processus.

When you code you have to know this important thing :

If you have 2 condition you have to use –> « If » and « else »

If you have 3 conditions you have to use –> « if » then « elif » then « else »

For example, I want that my bounds are given in the right order (« if ») then I do not want than my bounds are equal (« elif ») and finally I want to validate the processus if the 2 other options are not given by the user, so it is what we expected at the begin : the response –> (« else »)

Here is a schema that I made to explain how the program works

Paul's Schema
Paul’s Schema

Here is my code on GitHub : https://github.com/pololarinette/TC-1014/blob/master/%23WSQ07%20-%20Sum%20of%20numbers

Sum Numbers' code
Sum Numbers’ code

Have a nice day guys !

Paul

CC BY 4.0 #WSQ07 – Sum of Numbers by pololarinette is licensed under a Creative Commons Attribution 4.0 International License.