My specifications were:
- Create an empty list called
to_ten
.- Next, write a for loop that iterates over the numbers from 1 to 10 using the
range()
function and appends to the list whether the number is even or odd.You should end up with a list containing 10 elements with each entry being even or odd.
This is my code:
to_ten = []
for x in range(11):
to_ten.append(x%2==0)
to_ten
So far I am getting correctly whether they are even or odd but it is giving me true/false instead of simply saying even/odd for each number in my list.