Assignment 16 — simple conditional analysis
Due Monday, October 3
Program same_diff.py
- Produce a program that prompts for two integer inputs and reports whether or not they have same sign. There should be no other output.
- Two numbers have the same sign if they are either both positive or are both negative. For assignment purposes, zero is a positive number. If they have the same sign, display exactly the string
'have same sign'
and nothing else; otherwise, display exactly the string'have different signs'
and nothing else.
- Some possible program runs
Enter two numbers: 3 -5have different signs
Enter two numbers: -2 -1have same sign
Enter two numbers: 88888888 88888888have same sign
Enter two numbers: -12 11have different signs