This is a simple program that returns when a number is even or odd. What I want is to practice a function within another function, that's why this simple program.
Each of the functions have their respective arguments. The module "returnIfParOrImpar" goes inside the module "message_ReturnIfParOrImpar" and at the same time the latter goes into a main program (in which I will not use the module "returnIfParOrImpar" directly but that will be used by the module "message_ReturnIfParOrImpar.")
Module message_ReturnIfParOrImpar:
import retornoIfParOrImpar as nup
n=2
def retorno(n):
if nup.par_impar(n) == 0:
print("El numero es par")
else:
print ("El numero es impar")
Return moduleIfParOrImpar :
def par_impar(a):
residuo = a%2
return residuo
My question is that I am testing the module "messageReturnIfParOrImpar" and although it does not mark an error in the IDE, it does not print on the screen. Could this be declaring the arguments of the functions wrong?
Greetings to all.