

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Solucionario Práctica #5 Modularidad
Solucionario Practica #5 Modularidad 1. Realice una funcion que determine la cantidad de digitos pares que tiene un numero. 31356565 > 2 1359711 > 0 : ## 1 Cantidad de Pares def cuantosPares(num): res=0 while num!=0: if (num%10)%2==0: res+=1 num/ /=16 return res n=int(input("Introduce un numero")) print(t'el ndmero {n} tiene {cuantosPares(n)} pares‘) Introduce un ndmero894654113 El numero 894654113 tiene 4 pares 2. Realice una funcién que muestre cual es el digito mayor y otra funcién que diga cual es el digito menor de un numero dado. 12945385 > Fl mayor es 9 y el menor es 1 753245275 > El mayor es 7 y el menor es 2 : | ## 2 Mayor y menor de un numero def menor(num): res=10 while num!=0: dig=num%10 if dig