Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
Create an if-else statement that checks if a number is positive or negative.
Think about how you can determine if a number is greater or less than zero.
Write a for loop that prints the first 5 positive integers.
You want to iterate from 1 to 5.
What is the purpose of an if-else statement?
Think about what an if statement does.
True or False: For loops require a condition to stop iterating.
Consider how a for loop functions compared to a while loop.
Write a program that uses if-else statements to categorize animals based on their type: Mammals, Birds, etc. Use user input for animal type.
Use lists to define the categories of animals.
Write a program that prompts the user to enter a number and prints whether it's odd or even using a while loop.
Think about using the modulus operator to determine if a number is even or odd.
6 more questions in this section. Enroll free to practise them all.
Enroll free