In our previous post, we have seen how yeardatescalendar method works. yeardays2calendar is another method to get all days for a calendar year. It returns one list of month rows. Each row contains up to width number of months and each month contains weeks. The weekdays are a tuple of day and weekday number. If a day is not in a month, its number is 0.
Readyeardatescalendar method of python calendar module is used to get all dates for a specific year. It returns one list of rows of months. It takes one width parameter, that is used to define how many numbers of months each row should contain. Each month contains weeks between 4 to 6. Each week contains 1 to 7 days. Each day is a datetime.date object.
ReadPython calendar monthdays2calendar returns one list of weeks in a specific month and year. It returns the data as full weeks. Each data is a tuple holding day and weekday values.
Readmonthdatescalendar method of python module is used to get a list of weeks of a month of a specific year as full weeks. Each day of a week is represented as datetime.date object.
Readitermonthdays is defined in python calendar module. This method has four variants :.itermonthdays2(year, month), itermonthdays3(year, month, itermonthdays4(year, month)...
Readiterweekdays() is a function defined in python calendar standard library. It returns one iterator for the weekdays numbers. The first value is the first-week day value that can be retrieved by firstweekday().
ReadPython mathematical module math provides different mathematical constants and functions. One constant is for defining infinity. In this post, I will explain to you about constants and functions used for infinity. With
ReadThis is a python tutorial to reverse all words of a string. We will write one python program that will take one string as input and print out the new string by reversing all words in it.
ReadPython divmod method can be used to find out the quotient and remainder at one go. It takes two numbers as arguments and returns the quotient and remainder as pair. For example, if the numbers are a and b, if both are integers, it will return results as a/b and a%b. For floating-point numbers, it will return math.floor(a/b)
ReadPython built in split method of the re module can be used to split one string based on a regular expression. Regular expression can be used to split one string using multiple delimiters. In this quick tutorial, I will show you how to split a string with multiple delimiters in Python.
Read