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.
Write a code snippet to take two numbers as input and print their sum.
Use `int(input())` to convert input to integers.
What is the output when you input 5 and 3 in the sum program?
Add the two numbers together.
What is the purpose of the input() function in Python?
Think about what the program needs to function.
True or False: The modulo operator (%) is used to find the remainder after division.
Recall how division works and what remainder means.
Write a program that continuously asks for numbers from the user and reports their sum until the user types 'stop'.
Remember to initialize your sum variable before the loop.
Create a program that checks if a number is prime.
A prime number has exactly two positive divisors: 1 and itself.
5 more questions in this section. Enroll free to practise them all.
Enroll free