Skip to content

myKalling/Soft204

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages