37.6k views
4 votes
Write a program called odds_evens01 that reads a (non-empty) sequence of integers.

User Orujimaru
by
7.9k points

1 Answer

1 vote

Final answer:

To write a program called odds_evens01 that reads a sequence of integers, you can use a loop to iterate through each number in the sequence. Within the loop, you can check if the number is odd or even and store them in separate lists.

Step-by-step explanation:

To write a program called odds_evens01 that reads a sequence of integers, you can use a loop to iterate through each number in the sequence. Within the loop, you can use an if statement to check if the number is odd or even. If it's odd, you can add it to a separate list for odds. If it's even, you can add it to a separate list for evens. Finally, you can print both lists to display the odd and even numbers in the sequence.

User Marc Selman
by
7.2k points