Search This Blog

Saturday, 20 November 2021

Write a Python program to find whether a given number (accept from the user) is even or odd, print out an appropriate message to the user

Introduction
Here we are writing a program to find whether a given number is even or odd.

PROGRAM
----------------------------------------------
num = int(input("Enter a number: "))
mod = num % 2
if mod > 0:
    print("This is an odd number.")
else:
    print("This is an even number.")
----------------------------------------------
RESULTS : 

Enter a number: 5                                                                                             
This is an odd number.

No comments:

Post a Comment

how to implement YOLOv3 using Python and TensorFlow

Object Detection with YOLOv3 Introduction YOLOv3 (You Only Look Once version 3) is a real-time object detection algorithm that can detect ob...