Posts by edtech • 21 points
3 posts
-
1
votes3
answers252
viewsQ: Number of odd numbers
I created a function that returns the odd numbers. How do I return the amount of numbers, for example 4 odd, 3 odd, and so on? lista = [1,3,5,7,2,4] impar =[] def ehImpar(impar): for impar in lista:…
-
-1
votes2
answers4651
viewsQ: From a list, return even numbers in python
I am trying to return only the even numbers of a list1=[4,3,2,5,7,6] for the return in a Lista2=[2,4,6] I tried the recursive method with for but returns the error: Typeerror: Unsupported operand…
-
1
votes1
answer655
viewsQ: Conditional upon Bhaskara’s calculation
I’m trying to add a if to show the order of the increasing numbers in Bhaskara’s formula, however it shows error message if the root is negative or there are no roots. How can I adjust? import math…