Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Soft204 Python Scripts

This folder contains two simple Python scripts:

greeter.py

greeter.py asks the user for their name and prints a greeting.

Usage:

python greeter.py

or on Windows with the Python launcher:

py greeter.py

When prompted, type your name and press Enter.

Example:

What is your name? Alice
Hello, Alice!

calculator.py

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.py

or:

py calculator.py

The 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages