From 1b10bb150d6a6fabecb2861f3655586381a779af Mon Sep 17 00:00:00 2001 From: sharan Date: Sun, 3 Oct 2021 01:55:24 +0530 Subject: [PATCH 1/2] updte --- Python/Program33/Program33.py | 17 +++++++++++++++++ Python/Program33/Readme.md | 1 + 2 files changed, 18 insertions(+) create mode 100644 Python/Program33/Program33.py create mode 100644 Python/Program33/Readme.md diff --git a/Python/Program33/Program33.py b/Python/Program33/Program33.py new file mode 100644 index 00000000..cb1f31f6 --- /dev/null +++ b/Python/Program33/Program33.py @@ -0,0 +1,17 @@ + # defining a function to calculate HCF +def calculate_hcf(x, y): + # selecting the smaller number + if x > y: + smaller = y + else: + smaller = x + for i in range(1,smaller + 1): + if((x % i == 0) and (y % i == 0)): + hcf = i + return hcf + + # taking input from users +num1 = int(input("Enter first number: ")) +num2 = int(input("Enter second number: ")) + # printing the result for the users +print("The H.C.F. of", num1,"and", num2,"is", calculate_hcf(num1, num2)) \ No newline at end of file diff --git a/Python/Program33/Readme.md b/Python/Program33/Readme.md new file mode 100644 index 00000000..ece72b60 --- /dev/null +++ b/Python/Program33/Readme.md @@ -0,0 +1 @@ +Program to find HCF \ No newline at end of file From cf0ee2782abcc2dc8b9bfb54814271298f7ad168 Mon Sep 17 00:00:00 2001 From: sharan Date: Sun, 3 Oct 2021 01:59:18 +0530 Subject: [PATCH 2/2] updte --- Python/Program34/Program34.py | 7 +++++++ Python/Program34/Readme.md | 1 + 2 files changed, 8 insertions(+) create mode 100644 Python/Program34/Program34.py create mode 100644 Python/Program34/Readme.md diff --git a/Python/Program34/Program34.py b/Python/Program34/Program34.py new file mode 100644 index 00000000..2bbdaa28 --- /dev/null +++ b/Python/Program34/Program34.py @@ -0,0 +1,7 @@ +# First import the calendar module +import calendar + # ask of month and year +yy = int(input("Enter year: ")) +mm = int(input("Enter month: ")) +# display the calendar +print(calendar.month(yy,mm)) \ No newline at end of file diff --git a/Python/Program34/Readme.md b/Python/Program34/Readme.md new file mode 100644 index 00000000..940e13b3 --- /dev/null +++ b/Python/Program34/Readme.md @@ -0,0 +1 @@ +Program to display calender \ No newline at end of file