Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Python Program to Check if a Number is Odd or Even
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Python program to check if the input number is odd or even.
# A number is even if division by 2 gives a remainder of 0.
# If the remainder is 1, it is an odd number.

num = int(input("Enter a number: "))
if (num % 2) == 0:
print("{0} is Even".format(num))
else:
print("{0} is Odd".format(num))
6 changes: 6 additions & 0 deletions Python Program to Generate a Random Number
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Program to generate a random number between 0 and 9

# importing the random module
import random

print(random.randint(0,9))