From a5b252c1a96aaa6ff62ef02a81e34df8c4a0d5a0 Mon Sep 17 00:00:00 2001 From: Salem Benlechheb Date: Thu, 5 Jul 2018 02:55:01 +0200 Subject: [PATCH] Calendar code added --- Strings/strings_example_en.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Strings/strings_example_en.py b/Strings/strings_example_en.py index ed3ec8b..e52b08f 100644 --- a/Strings/strings_example_en.py +++ b/Strings/strings_example_en.py @@ -19,4 +19,17 @@ #example 3 #added by @remon str3 ="2018" -print(str3) \ No newline at end of file +print(str3) + +#example 4 +#added by Salem Benlechheb +#added by @elmakikadir1983nwsn +#Now with Python you can view the number of leap +#years between two specific years. This is an example of the code you can use. +import calendar +print(">>>>>>>>>>Leap Year Calculator<<<<<<<<<<\n") +y1=int(input("Enter the first year: ")) +y2=int(input("Enter the second year: ")) +leaps=calendar.leapdays(y1, y2) +print("Number of leap years between", y1, "and", +y2, "is:", leaps)