(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to determine whether a given year is a leap year. Sample Solution: Python Code: def leap_year(y): if y % 400 == 0: return True if y % 100 == 0: return False if y % 4 == 0: return True …
Day: March 15, 2021
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python script to display the various Date Time formats. a) Current date and time b) Current year c) Month of year d) Week number of the year e) Weekday of the week f) Day of year g) Day of the month h) …
(Python Example for Citizen Data Scientist & Business Analyst) Write a Python program to find the greatest common divisor (gcd) of two integers. Sample Solution: Python Code: def Recurgcd(a, b): low = min(a, b) high = max(a, b) if low == 0: return high elif low == 1: return 1 else: return Recurgcd(low, …