Project Level 1: Beginner
This project is designed for beginner learners who are still learning and practicing Python fundamentals.
Project Description
Build a program that the user to input two numbers and an operation (addition, subtraction, multiplication, or division). It performs the operation on the two numbers and displays the result.
How the Project Works
The program lets the user input two numbers (e.g., 4 and 8). Then, the program lets the user input an operation (e.g., * for multiplication). Finally, the program displays the result of the operation.
Prerequisites
Required Libraries:
Required Files: No files are required.
IDE: You can use any IDE on your computer to code the project.
Danger Zone
Once you code the project, compare it with our solutions below.
I realized that
print("nivel 1: principiante lunes")
print()
num1 = int(input("ingrese el primer numero: "))
num2 = int(input("ingrese el segundo numero: "))
op = input("ingrese la operacion (+, -, *, /): ")
if op == "+":
result = num1 + num2
print(result)
elif op == "-":
result = num1 - num2
print(result)
elif op == "*":
result = num1 * num2
print(result)
elif op == "/":
result = num1 / num2
print(result)
else:
print("la operacion no es valida")