Python Program Check Positive Number – Write a Python program to input a number and check whether the given number is positive, negative or zero. Use Python if-elif-else construct.
Python Program Check Positive, Negative or Zero Number
# Python program to check a number # for positive, negative or zero num = int(input('Enter a number: ')) if num > 0: print('The number is positive') elif num < 0: print('The number is negative') else: print('The number is zero')
Output
Enter a number: 7
The number is positive
Enter a number: -56
The number is negative
Enter a number: 0
The number is zero
Python GUI ( Graphcal User Interface ) Programs using tkinter Module
Python GUI ( Graphcal User Interface ) Programs using tkinter Module |
- Find Factorial by Recursive Function Python GUI Program
- Multiplication Table Python GUI Program
- Python GUI Program Area of Triangle with base and height
- Python GUI Temperature Conversion Program Celsius to Fahrenhiet
- Python GUI Program Temperature Conversion Fahrenheit to Celsius
- Python Pounds to Kilogram Converter GUI tkinter Program
- Python 3 Four Function Calculator Program tkinter GUI
- Python Digital Clock Program using tkinter GUI
- Python Quotes Changer Program tkinter GUI
- Python 3 tkinter Spinbox GUI Program Example
- Python 3 tkinter Message Widget Program Examples
- Python 3 GUI Program tkinter Radio Buttons
- Adding Menus to Python 3 tkinter GUI Programs
- Python 3 GUI Program Add Two Numbers
- Explain Python grid Geometry Manager with Example Code
- Python 3 GUI Miles to Kilometers Converter tkinter Program
- Python 3 tkinter GUI Kilogram to Pounds Program
- Python Set Label Text on Button Click tkinter GUI Program
- Show Label and Button Widgets Python Tkinter Program
- Python 3 Tkinter GUI Hello World Program
- Create and Show Root Window of tkinter GUI Program