Practice · Python

Practice User Input

Read text with input(), convert it to the needed type, and echo a computed response.

User Inputwarming python…

Space Greeting and Sum

Write a function space_greeting() that interacts with the user via input(). It should:

  1. Prompt for a name.
  2. Prompt for two integers (one after the other).
  3. Return a single string formatted as:
Hello <name>! The sum of your numbers is <sum>

The sum must be numeric addition, not string concatenation. Example:

  • Input: "Ada", "4", "5" → Return: "Hello Ada! The sum of your numbers is 9".
  • Input: "", "0", "0" → Return: "Hello ! The sum of your numbers is 0".
Press Run to see output, or Check to grade against the tests.

Want a whole course built around user input?

Start my path — free

Adaptive practice, streaks, projects with real code review. Free tier gates AI help, never content.