This folder contains two simple Python scripts:
greeter.py asks the user for their name and prints a greeting.
Usage:
python greeter.pyor on Windows with the Python launcher:
py greeter.pyWhen prompted, type your name and press Enter.
Example:
What is your name? Alice
Hello, Alice!
calculator.py is a simple calculator that reads two numbers and an operator from the user.
The script includes input validation for numbers and handles division by zero.
Usage:
python calculator.pyor:
py calculator.pyThe program will:
- ask for the first number
- ask for an operator (
+,-,*,/) - ask for the second number
- perform the calculation
- print the result
If a non-numeric value is entered, the script shows a friendly error and asks again.
If division by zero is attempted, the script prints Cannot divide by zero.