Write a NumPy program to count the number of days of specific month.
import numpy as np print("Number of days, February, 2016: ") print(np.datetime64('2016-03-01') - np.datetime64('2016-02-01')) print("Number of days, February, 2017: ") print(np.datetime64('2017-03-01') - np.datetime64('2017-02-01')) print("Number of days, February, 2018: ") print(np.datetime64('2018-03-01') - np.datetime64('2018-02-01'))
Sample Output:
Number of days, February, 2016: 29 days Number of days, February, 2017: 28 days Number of days, February, 2018: 28 days
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer