Custom: Simple Calculator
Beginner
Python
15 XP
📋 Challenge
Let's build a simple calculator that can add, subtract, multiply, and divide two numbers.
Here's what your program should do:
1. Ask the user to enter the first number.
2. Ask the user to enter the second number.
3. Ask the user to choose an operation: '+', '-', '*', or '/'.
4. Perform the calculation based on the chosen operation.
5. Print the result in a user-friendly way (e.g., "The sum is: 5").
Important: Make sure your program handles division by zero gracefully (it should print an error message instead of crashing).
✅ Expected Output
Example 1:
Enter the first number: 10
Enter the second number: 5
Enter the operation (+, -, *, /): +
The sum is: 15.0
Example 2:
Enter the first number: 8
Enter the second number: 2
Enter the operation (+, -, *, /): /
The result of the division is: 4.0
Example 3:
Enter the first number: 7
Enter the second number: 0
Enter the operation (+, -, *, /): /
Error! Division by zero is not allowed.
💡 Need Help?
Click to reveal hints one at a time.
Your Progress
Status: Pending